Passing variables between pages with php
Posted: Mon Mar 15, 2004 6:30 am
I am fairly new to php and I am having some difficulty passing variables between pages using hyperlinks.
Im using a table to generate a list of items pulled from a database and hyperlinks to link the items to a second php page. This is the code I am using…
<td><a href="item.php?item=' . $row['ItemID'] . '">' . $row['ItemName'] . '</a></td>
This all seems to work fine until I get to the second page where I am unable to use the variable.
Is there any code that I need to include on the second page to retrieve the variable? So far I have been using $item which doesn’t seem to work.
Im using a table to generate a list of items pulled from a database and hyperlinks to link the items to a second php page. This is the code I am using…
<td><a href="item.php?item=' . $row['ItemID'] . '">' . $row['ItemName'] . '</a></td>
This all seems to work fine until I get to the second page where I am unable to use the variable.
Is there any code that I need to include on the second page to retrieve the variable? So far I have been using $item which doesn’t seem to work.