alohatofu Posted April 4, 2008 Share Posted April 4, 2008 I'm using a formmail - which upon submission, process a form, then redirect them to a php page that I created. How do I go about in post whatever message the user submitted on that form? Quote Link to comment https://forums.phpfreaks.com/topic/99568-display-message-on-redirect-form-after-submission/ Share on other sites More sharing options...
drisate Posted April 4, 2008 Share Posted April 4, 2008 Your gona have to give more information if you would like an awnser ... Post us the code. To redirect use the meta redirection and to get the form data use $_POST Quote Link to comment https://forums.phpfreaks.com/topic/99568-display-message-on-redirect-form-after-submission/#findComment-509356 Share on other sites More sharing options...
alohatofu Posted April 4, 2008 Author Share Posted April 4, 2008 My form <form method="POST" action="http://directory_to_formmail/submitform" name="mail_form"> <input type="hidden" name="mailto" value="myemail@email.com"> <textarea name="message" wrap=physical cols=23 rows=4></textarea> <input type="submit" value="Send"> <input type="reset" value="Clear"> <input type="hidden" name="redirecturl" value="http://myweb.com/redirect.php> when the user submitted and redirected to redirect.php, I would like to display the $message. on redirect.php I have $body = $_POST['message']; echo $body; but it does not work Quote Link to comment https://forums.phpfreaks.com/topic/99568-display-message-on-redirect-form-after-submission/#findComment-509367 Share on other sites More sharing options...
drisate Posted April 4, 2008 Share Posted April 4, 2008 The code would look like <?php $sec="5"; echo $_POST[message]."<br><br><b>You will be redirected to $_POST[redirecturl] in 5 seconds</b>"; echo '<meta http-equiv="refresh" content="'.$sec.';url='.$_POST[redirecturl].'"/>'; ?> Quote Link to comment https://forums.phpfreaks.com/topic/99568-display-message-on-redirect-form-after-submission/#findComment-509396 Share on other sites More sharing options...
drewbee Posted April 4, 2008 Share Posted April 4, 2008 It seems that you are new to PHP. Please, PLEASE as a very basic security concern use the function htmlspecialchars() on any variable that is collected from user input and displayed on any page. Doing this helps prevent XSS injection attacks. Quote Link to comment https://forums.phpfreaks.com/topic/99568-display-message-on-redirect-form-after-submission/#findComment-509406 Share on other sites More sharing options...
alohatofu Posted April 4, 2008 Author Share Posted April 4, 2008 The code would look like <?php $sec="5"; echo $_POST[message]."<br><br><b>You will be redirected to $_POST[redirecturl] in 5 seconds</b>"; echo '<meta http-equiv="refresh" content="'.$sec.';url='.$_POST[redirecturl].'"/>'; ?> I'm still not sure what you mean by that. Where do i insert that code to? what what does it do? Quote Link to comment https://forums.phpfreaks.com/topic/99568-display-message-on-redirect-form-after-submission/#findComment-509445 Share on other sites More sharing options...
alohatofu Posted April 4, 2008 Author Share Posted April 4, 2008 could someone pleaseeee help? Quote Link to comment https://forums.phpfreaks.com/topic/99568-display-message-on-redirect-form-after-submission/#findComment-509532 Share on other sites More sharing options...
Asheeown Posted April 4, 2008 Share Posted April 4, 2008 The code would look like <?php $sec="5"; echo $_POST[message]."<br><br><b>You will be redirected to $_POST[redirecturl] in 5 seconds</b>"; echo '<meta http-equiv="refresh" content="'.$sec.';url='.$_POST[redirecturl].'"/>'; ?> What this means is that it takes the message posted in the form $_POST[message] and your redirect url "$_POST[redirecturl]" and makes a text display...for example This is the users message that will be posted here You will be redirected to www.domain.com/somefile.php in 5 seconds Then it redirects them in 5 seconds Quote Link to comment https://forums.phpfreaks.com/topic/99568-display-message-on-redirect-form-after-submission/#findComment-509554 Share on other sites More sharing options...
alohatofu Posted April 4, 2008 Author Share Posted April 4, 2008 Right, but what I'm trying to achieve is that when the user submit, the form process via the formmail <form method="POST" action="http://webapps/mailer/submitform" name="mail_form"> and it's emailing the form to a user. then redirect the user to a page. right now I got everything working except it does not carry the message over to the new page. I even did this <input type="hidden" name="redirecturl" value="http://mywebpage/abc/<?php echo "pagingtestconfirm.php?message=$POST_['message']&itemId=$itemId&memberId=$memberId"; ?>> Quote Link to comment https://forums.phpfreaks.com/topic/99568-display-message-on-redirect-form-after-submission/#findComment-509558 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.