$HTTP_POST_VARS help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
tfergusan
Forum Newbie
Posts: 2
Joined: Wed Jul 06, 2005 1:30 pm

$HTTP_POST_VARS help

Post 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.
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post 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
tfergusan
Forum Newbie
Posts: 2
Joined: Wed Jul 06, 2005 1:30 pm

Thanks

Post by tfergusan »

Thanks a lot. Works great.
Post Reply