PDA

View Full Version : Passing variables


tkone
02-16-2000, 05:36 AM
Is there an easy way to pass varibles from one page to the next?[nbsp][nbsp]
1. I have a form (index.shtml) where you enter data

2. Then when the preview button is clicked it runs a script (order.php3)that queries the database for more details and displays both the form data and data from the database.

3.[nbsp][nbsp]When you click the confirm button it runs a script (order_confirm.php3) which grabs certain varibles and email/posts to database.

The problem I'm having is getting a hold of these varibles that reside in the order.php3 script and properly referring to them in my order_confirm.php3

Any ideas would be appreciated
cheers
Tom K

dean
02-16-2000, 10:11 AM
I am not the guru but I do this 2 ways:

Using standard forms and form buttons I would:
The variables get passed with the form automatically but if I need other variables to be passed I would use 'hidden' for php to pass database variables I would:
<INPUT TYPE=HIDDEN NAME=&quot;to_update&quot; VALUE=&quot;<? echo HtmlSpecialChars($rand_site)?>&quot;>[nbsp][nbsp]

Where $rand_site was a variable from a database

or....
To just pass variables with out a form I would using standard links:
echo &quot;<a href=\&quot;http:\\www.your-site.com\page.php3&amp;$name$&amp;$to_update\&quot;>Click pass to next page</a>&quot;;