Attila Posted August 22, 2008 Share Posted August 22, 2008 OK trying to use a name that I pull out of a database to go from one page to the next. When it goes to the next page it will pull up that persons blog stuff. Here is the coding I am using on the link they can click on. <? echo '<a href=test1.php?'.$_POST[uname] = $row['maintoonsname'].'>'.$row['maintoonsname'].'</a>' ?> example the toons name is: John. I want John to be hyperlinked to another page in the example above the link is test1.php. When they click on John to go to the next page. I need that name "John" to be put into a variable called Uname so on the next page I can search for John in the database and display all his information. How do I do this? WOW I am confusing myself. You can see a partial example here: http://thaczero.com/test.php Link to comment https://forums.phpfreaks.com/topic/120935-solved-sending-a-variable-from-one-page-to-another/ Share on other sites More sharing options...
ratcateme Posted August 22, 2008 Share Posted August 22, 2008 you want this <? echo '<a href=test1.php?'.$_POST[uname] .'='. $row['maintoonsname'].'>'.$row['maintoonsname'].'</a>' ?> but also check out $_SESSION Scott. Link to comment https://forums.phpfreaks.com/topic/120935-solved-sending-a-variable-from-one-page-to-another/#findComment-623388 Share on other sites More sharing options...
ballhogjoni Posted August 22, 2008 Share Posted August 22, 2008 If I understand you right, you want change your code to: <?php echo '<a href="test1.php?Uname='.$row['maintoonsname'].'">'.$row['maintoonsname'].'</a>' ?> Then on test1.php use the $_GET to plug the $row['maintoonsname'] info into a query to grap the info you need from the db. IE...$_GET['Uname'] Link to comment https://forums.phpfreaks.com/topic/120935-solved-sending-a-variable-from-one-page-to-another/#findComment-623389 Share on other sites More sharing options...
Attila Posted August 22, 2008 Author Share Posted August 22, 2008 Thansk that simple stuff did it! Link to comment https://forums.phpfreaks.com/topic/120935-solved-sending-a-variable-from-one-page-to-another/#findComment-623401 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.