Hello Paul,

Wednesday, January 7, 2004, 1:45:20 AM, you wrote:

P> Thanks. The problem exists either way! For some reason that is beyond me,
P> the combination of a javascript being called and the document being parsed
P> through php is the cause. Again if I simply rename to .htm then it is
P> "fine."

It's not the JavaScript causing it (see below).

P> I would prefer not to have to tell the users "dont use the browser back
P> button, use the back button icon on the page instead." and force the page to
P> not be cached. Any other ideas?

Look at the standard HTTP Header from a PHP session:

HTTP/1.1 200 OK
Date: Wed, 03 Dec 2003 03:02:04 GMT
Server: Apache/1.3.27
X-Powered-By: PHP/4.3.2
Set-Cookie: PHPSESSID=9698e85f93d57ec844194ae7943552c8; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0,
pre-check=0
Pragma: no-cache
Connection: close
Content-Type: text/html

Specifically the cache-control. PHP has these settings by default so
you can NEVER rely on the browser to "remember" form data because if
it adheres to the HTTP Headers (which it ideally should), it's going
to blank it all.

Here's an option for you that I use:

1) On your page with the form, submit the data via a transfer
(XT) script. This script places all of the form values into session
variables and then redirects to Page 2.

2) On the next page display whatever you need. If they click BACK in
their browser, it's going to return to the first page, not your XT
file. This page should, at the start of it, check for the existence of
the session variables. If they exist and the data is safe, populate
the form with it.

Basically using this method you can "save" the form contents for
however long you want the session to exist and when they go back to
that page (either by typing the URL in directly or using the Back
button in their browser) the data will be ready for you to populate
the form with.

If you want some example code just shout.

-- 
Best regards,
 Richard                            mailto:[EMAIL PROTECTED]

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

Reply via email to