Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing a result as a variable problem

Status
Not open for further replies.

newphpbie

Programmer
Oct 17, 2003
110
GB
Hi,

I have a table of results from a query. I want to make one of the columns of results as hyperlinks to another page.

I am doing this with the lines....
Code:
print(&quot;<td width=\&quot;15%\&quot; bgcolor=\&quot;$color\&quot;>&quot;); 
print(&quot;<a href=ExtDetails.php?id=&quot;.$row[6].&quot;>$row[6]</a></td>&quot;);

As you can see, I am calling the result (row 6) and putting it in a table cell. I am also trying to carry the result as a variable with the hyperlink.

If I hold the mouse over the link I get what I'd expect to see...the link and the varaible....

Example
...../ExtDetails.php?id=106

but when I try and collect and display the variable on the ExtDetails.php page it doesn't work.

ExtDetails.php simply consists of...

Code:
<?php
session_start();

$extid=$_POST['id'];
$_SESSION['extid_s']=$extid;

print $extid_s;
print $extid;

?>

But nothign appears... Is there something about passing a result as a variable that is stopping this from working??

Or any other ways of doing this?

Any ideas would be much appriciated...

TIA

Tony
 
When using the ? in the url, the result has te be imported with $_GET['id'], not $_POST.

--------------------------------------
It's not the monsters under your bed, it is the men next door.
That make you fear, make you cry. Make you cry for the Child.
All the wars are fought amongst those lonely men. Unharmed, unscarred.
 
the ? is the seperator between the query string and the URL...

Known is handfull, Unknown is worldfull
 
Fantastic, thanks...

I'm a little dissapointed I didn't realise that myself, but hey, it's Monday. and I'm tired...

Thanks again...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top