Jump to content

Displaying "Saved" text after processing form.


acctman

Recommended Posts

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.

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
}

  • 2 weeks later...

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.