[PHP] The data get lost when click back button

2007-06-16 Thread Tom
My problem:

I have a form for that the users register indicating a user's name and 
password and other data.
Previously to add the user in the data base I verify that user's name 
doesn't already exist. In that case I show an error message and I ask him to 
attempt it again.
But,  when the user returns to the form all the data of the fields 
disappeared! Then the user has enter all the information again.

How can I make in simple way that, the data in the fields don't get lost 
when the user returning to the form?

Ahead of time, thank you very much,

Tom.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] The data get lost when click back button

2007-06-16 Thread Paul Scott

On Sat, 2007-06-16 at 12:47 -0300, Tom wrote:
 How can I make in simple way that, the data in the fields don't get lost 
 when the user returning to the form?

You can add the field data to a session:

$field1 = $_GET['field1'];
$_SESSION['field1'] = $field1;

// then to get them back again

if(isset($_SESSION['field1']))
{
$field1 = $_SESSION['field1'];
}

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/uwc2006/content/mail_disclaimer/index.htm 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] The data get lost when click back button

2007-06-16 Thread tedd

At 12:47 PM -0300 6/16/07, Tom wrote:

My problem:

I have a form for that the users register indicating a user's name and
password and other data.
Previously to add the user in the data base I verify that user's name
doesn't already exist. In that case I show an error message and I ask him to
attempt it again.
But,  when the user returns to the form all the data of the fields
disappeared! Then the user has enter all the information again.

How can I make in simple way that, the data in the fields don't get lost
when the user returning to the form?

Ahead of time, thank you very much,

Tom.


Try Googling sticky forms.

http://www.informit.com/articles/article.asp?p=412930seqNum=3rl=1

Cheers,

tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php