Could someone give me a little snippet of sample code to get me rolling? I have a form and I would like to have a confirmation page show up first before sending the form off to the mysql d-base. Like this.
--------------
You have submitted the following info:
blah
blah
blah
Is this correct Yes/No
--------------
Yes - send on the form info to the d-base
No - returns you to the form
Hi gszczyrb!
I'm already a newbie to php, but i would try something like this:
Form.php3 then goes to confirm.php3 which looks like this.
<html><body>
You have submitted the following info:
<?
{
echo "age: $age<br> name: $name<br> height: $height<br>
Is this information correct?
<a href="submit.php3?age=$age&name=$name&height=$height">Yes, go on</a><br>
<a href="form.php3?age=$age&name=$name&height=$height">No, go back</a>
";
}
?>
If yes is selected, it goes to submit.php3 where the variables are added to mysql.
If no is selected, it goes back to form.php3 where the information the user previously entered will be found as the default in the textboxes.
submit.php3 is simply a page which has the code to add the variables to MySQL and says..."Thankyou, your information has been entered"
I have not tested this but it should work ok.
Let me know
Basil
Thanks to both of you. Martin I wasn't able to get yours to work, but that is probably just my amateurness showing. I do understand more about 'switch' now though. Thanks.
Tantrum, I used your script and it works great. Exactly what I was looking for. Thanks.
One more question. In the final part, when it passes the variables to submitform.php, is there a limit on the number of varaibales I can pass? It worked fine in my test dbase with only six variables, but my real dbase has over 40 variables.
Thanks again
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by gszczyrb:
One more question. In the final part, when it passes the variables to submitform.php, is there a limit on the number of varaibales I can pass? It worked fine in my test dbase with only six variables, but my real dbase has over 40 variables.
Thanks again[/quote]
I dont think so gszczyrb. There probably is a limit...but i think 40 or 50 should work fine http://www.devshed.com/Talk/Forums/smile.gif
Basil
The maximum length you can pass thru an URL is about 2.000 characters (i've read this in the german book "php - Grundlagen und Loesungen") And everything counts even variable names, values and seperators.