Jump to content

[SOLVED] Sending a variable from one page to another


Attila

Recommended Posts

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

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']

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.