Page 1 of 1

$HTTP_POST_VARS help

Posted: Wed Jul 06, 2005 1:52 pm
by tfergusan
I'm using html, php and mysql. I am using a php "while loop" to pull all the data out of a table


while($stuff = mysql_fetch_row($view))


and then display it in a table on a website.


<td colspan="2"> <? echo ($stuff[1]); ?>
ect.

One of the columns is a short description. I have a button under it that when clicked opens a new page which needs to pull the long description column out of the same table and displays it on the page. I also have an ID column. How do I pass the value of the ID column to the new page so I can do a query.

Posted: Wed Jul 06, 2005 2:02 pm
by hawleyjr
store the ID to a hidden HTML field:

Code: Select all

<input type=&quote;hidden&quote; name=&quote;thisID&quote; value=&quote;<?php echo $myID;?>&quote;>
On your onClick() event of the button send the ID via the $_POST or $_GET

Thanks

Posted: Wed Jul 06, 2005 2:40 pm
by tfergusan
Thanks a lot. Works great.