Re: [PHP-DB] retaining form information when someone presses back

2007-01-03 Thread Chris

Christopher Blöcker wrote:

Flint Million:

This might not be relavent for this forum, so if not please direct me
to the proper one; although I do like to keep my email list
subscriptions down.

I have a custom application in PHP in which a user fills out a form of
information. When the user submits, I perform sanity checking on the
user's submitted data and refuse to actually process/insert it if
those checks fail. However, my users are complaining that when they
press back to correct, all the data is gone from the form and they
have to re-enter it all. I know many websites that can retain the form
data when someone presses back; how is this done?

Flint M



ok, an input field might be something like name='username' size='8' maxlegth='32'> --> the submitted variable would 
be stored in $_POST["username"] (or $_GET["username"] depending on what 
method you use to submit it)


Please no!

*At least* use htmlentities or htmlspecialchars to stop xss attacks.

If I put:

alert('x');

as my username, and that alerts 'x', then I can steal cookies from your 
computer and other bits of info as well.


--
Postgresql & php tutorials
http://www.designmagick.com/

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



Re: [PHP-DB] retaining form information when someone presses back

2007-01-01 Thread J R

try using:
header ("Cache-control: private");

i'm not sure that will work, try playing with header cache-control. anyway
as Bastien metioned it is better to have your form redisplayed with values
the user entered when validation failed rather than asking the user to click
the back button of their browser.

try this sample (not tested, too lazy :) but should work):
';
echo "";
echo "";
echo '';
echo '';

?>

On 1/1/07, Flint Million <[EMAIL PROTECTED]> wrote:


This might not be relavent for this forum, so if not please direct me
to the proper one; although I do like to keep my email list
subscriptions down.

I have a custom application in PHP in which a user fills out a form of
information. When the user submits, I perform sanity checking on the
user's submitted data and refuse to actually process/insert it if
those checks fail. However, my users are complaining that when they
press back to correct, all the data is gone from the form and they
have to re-enter it all. I know many websites that can retain the form
data when someone presses back; how is this done?

Flint M

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





--
GMail Rocks!!!


Re: [PHP-DB] retaining form information when someone presses back

2007-01-01 Thread Christopher Blöcker

Flint Million:

This might not be relavent for this forum, so if not please direct me
to the proper one; although I do like to keep my email list
subscriptions down.

I have a custom application in PHP in which a user fills out a form of
information. When the user submits, I perform sanity checking on the
user's submitted data and refuse to actually process/insert it if
those checks fail. However, my users are complaining that when they
press back to correct, all the data is gone from the form and they
have to re-enter it all. I know many websites that can retain the form
data when someone presses back; how is this done?

Flint M



ok, an input field might be something like name='username' size='8' maxlegth='32'> --> the submitted variable would 
be stored in $_POST["username"] (or $_GET["username"] depending on what 
method you use to submit it)
your back-button should now contain a link like href='fill-in-form.php?username=$_POST["username"]'>back to keep the 
information
an other possibility might be using cookies but this would be impossible 
if the user refuses to accept cookies, so this method might not be wanted


Chris

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



RE: [PHP-DB] retaining form information when someone presses back

2007-01-01 Thread Bastien Koert
i tend to have a function that show the form and a processing function. In 
the processing function i preform my sanity checks and then if there are 
errors pass the $_POST data back to the show_form($data, $errors) with the 
relevant errors. This removes the need to have the users press the back 
button and allows the form to show its data again..


Bastien



From: "Flint Million" <[EMAIL PROTECTED]>
To: php-db@lists.php.net
Subject: [PHP-DB] retaining form information when someone presses back
Date: Mon, 1 Jan 2007 02:13:37 -0600

This might not be relavent for this forum, so if not please direct me
to the proper one; although I do like to keep my email list
subscriptions down.

I have a custom application in PHP in which a user fills out a form of
information. When the user submits, I perform sanity checking on the
user's submitted data and refuse to actually process/insert it if
those checks fail. However, my users are complaining that when they
press back to correct, all the data is gone from the form and they
have to re-enter it all. I know many websites that can retain the form
data when someone presses back; how is this done?

Flint M

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



_
Enter the "Telus Mobility Xbox a Day" contest for your chance to WIN!  Telus 
Mobility is giving away an Microsoft Xbox® 360 every day from November 20 to 
December 31, 2006! Just download Windows Live (MSN) Messenger to your 
IM-capable TELUS mobile phone, and you could be a winner!  
http://www.telusmobility.com/msnxbox/


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