Re: [PHP4BETA] Browser BACK/Forward Button with Form
| From: | Sascha Schumann | Date: | Thu, 20 Apr 2000 14:18:03 +0000 |
| Subject: | Re: [PHP4BETA] Browser BACK/Forward Button with Form | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-13790@lists.php.net to get a copy of this message | ||
> ability to show them the problems in a form they're filling in.
> My forms are generated by PHP, often based on entries in a previous form.
> The user fills in the form and hits submit. I then notice if something is
> missing, and if so I tell them what it is, I show the message for a few
> seconds, and then send them back to the same form with a history.back() thing.
There is another method with these advantages:
- does not rely on Javascript
- does not rely on working Back-button
- lets you flag fields, if their content is not valid
And it's simple. It goes like this:
Display the error message
Display the form with the previous values inserted
This is the most convenient method for users, because they have
error message and input fields easily available on one page.
> A related issue is that I often would want to look at the generated source
> of a PHP page, for debugging purposes. Which, again, the standard session
> scheme would stop me from doing if there are forms involved, because the
> page instantly expires. I seem to be able to get around that by adding a
> header like:
> header("Expires: " . gmdate("D, d M Y H:i:s",time()+3600) . "
> GMT");
> after calling the session_register() function.
Set session.cache_limiter to private. Then your browser will keep
a local copy in its cache, while proxies will not cache the
document.
- Sascha