acctman Posted October 15, 2008 Share Posted October 15, 2008 I have a form on profile.html (template with xhtml/css/php coding inside) after user clicks the submit button I would like to send the user back to profile.html and display "Changes have been saved." at the top of the page or if this can be done, send the user back to profile.html and just show "Changes have been saved." in the center of the page. I guess this could be down with a div show/hide hiding the entire form/page text and just showing a div that has the saved text centered. If anyone can help me with either method that would be great thanks. Quote Link to comment https://forums.phpfreaks.com/topic/128581-displaying-saved-text-after-processing-form/ Share on other sites More sharing options...
sKunKbad Posted October 16, 2008 Share Posted October 16, 2008 You would do this with php, by detecting that the form was submitted. You can do this in numerous ways. A common way to detect if a form has been submitted is by checking for GET or POST arrays. For instance: if($_POST){ // show the "changes have been saved" dialog }else{ // show the form } Quote Link to comment https://forums.phpfreaks.com/topic/128581-displaying-saved-text-after-processing-form/#findComment-666847 Share on other sites More sharing options...
BoltZ Posted October 25, 2008 Share Posted October 25, 2008 To expand a little on what he said you could do this. <?php if($_POST){ include('header.html'); echo "Saved <br /><br />"; include('form.php'); //this is your form file. You probably dont have it in an include include('footer.html'); }else{ // show the form } You do not need a div which will hide it and show it after. Quote Link to comment https://forums.phpfreaks.com/topic/128581-displaying-saved-text-after-processing-form/#findComment-674304 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.