Subject: daatbase
Posted By: depkel Post Date: 4/10/2006 10:24:44 AM
hi friend

how to pass variables between 2 forms pages
my version is php5
pls give the syntaz of earlie version also

regards
deepak
 


dee
Reply By: janise Reply Date: 4/19/2006 3:20:32 AM
To pass variables from one page to another you encode the variables in the URL or add to the form information to be submitted (as these two ways are basically how you get from one page to another).

For example, a link on the first page
<a href="second.php?x=123&amp;y=abc">Go to the second page</a>
will open the second page which will have access to (global) variables $x and $y.

If you submit a form then all its variables are accessible to the second script, for example
<form action="second.php" method="POST">
<input type="text" name="x" />
<input type="hidden" name="y" value="abc" />
<input type="submit" name="submit" value="Submit!">
</form>

will get the user input to the second script in variable $x and "abc" in variable $y.

Other ways to (more permanently) store user data would be to store it in cookies, session variables or data base.


Go to topic 42743

Return to index page 310
Return to index page 309
Return to index page 308
Return to index page 307
Return to index page 306
Return to index page 305
Return to index page 304
Return to index page 303
Return to index page 302
Return to index page 301