Jump to content

How to Save Post data.. w/o using cookies


Azaz

Recommended Posts

Ok well I submit my form and go back and all the fields are completely empty....

 

Like if I make this post then click back I can see everything I wrote, am I missing something?

 

Is it even related to php or a html missing structure?

 

 

Link to comment
Share on other sites

Take a look at the $_SESSION variable, this might help.

 

For example, I assume you are verifying the form inputs on the submit page? If so, then something like this:

session_start(); //Run this statement before outputting anything to the browser
foreach ( $_POST as $foo=>$bar ) {
        $_SESSION[$foo] = $bar;
}
//Perform verification here

 

Then if you need to return to your form because they havent filled something in correctly, send them back and do something like this:

<input type="text" <?php if(isset($_SESSION['myid'])) echo "value=\"".$_SESSION['myid']."\""; ?> id="myid">

 

Link to comment
Share on other sites

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.