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

Link to comment
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.