Jump to content

Displaying "Saved" text after processing form.


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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.