Forum Moderators: coopster

Message Too Old, No Replies

does not pass variables through url post

         

ice101man

8:50 pm on Nov 18, 2004 (gmt 0)

10+ Year Member



i can not figure out why this will not pass a variable to another php page. Ive tried several things can you help me out. I enter the client_num in the text field hit the flights button but no value is passed

<a href="flights.php">
<input type="hidden" name="var" value="<?=$Client_num?>" />
<img border="0" src="images/flightsbutton%20copy.jpg" width="113" height="64">
</a></TD>

the other page contains

$Client_num = $_POST['var'];

Salsa

10:35 pm on Nov 18, 2004 (gmt 0)

10+ Year Member



It looks like you're trying to use a hidden form filed in a link. That's not going to work. Form fields need to be within <form></form> tags for them to work. The way to include a variable in a link is to include it in the query string of your URL, like <a href="flights.php?Client_num=$Client_num>.... Then retrieve it with $_GET['Client_num'];

If you want to keep the variable out of the URL, you might be able to get that effect by making a form with the hidden fields you want in it, then creating a custom submit button using your flightsbutton image. If you need to further sort that method out, you should take it to the HTML and Browsers [webmasterworld.com] forum.

I hope this helps