Garry Jones wrote:Garry,> When processing a form I am reading in a value to a mysql database. I then
> redirect the user to a "thank you" page with Header. What I would like is to
> remind the user the value he has keyed in.
> In the following can I store $inx01 and echo its value in thankyou.php?
> mysql_connect(" Codes Removed ") or die(mysql_error());
> mysql_select_db(" Database Name removed ") or die(mysql_error());
> mysql_query("INSERT INTO table1 VALUES ('$inx01')");
> echo mysql_error();
> Header("Location: http://www.mydomain.com/thankyou.php");
> Garry Jones
You can, but you'll have problems. First of all, you are inserting values into
the table, but not deleting them. Which will be the correct value (remember -
database entries are not ordered).
Even if you delete the entry from the table in your second page, what happens
when two people hit the submit button at the same time? Requests are not
necessarily processed in order - in fact one request isn't necessarily completed
before the next one starts. One user could get the other user's value, and if
you delete the value in your second page, one user may get an error because the
value isn't there.
A better way to store it would be to use sessions.
Remove the "x" from my email address
JDS Computer Training Corp.