Jump to content

[SOLVED] Supplying details to page through url


nadz

Recommended Posts

hi, basically i'd like my users to be able to give their friends a link like this:

 

ww.mysite.com/index.php?id=[users id number]

 

and id like to use the id number supplied in a mysql query on the page. in abit more detail, the page contains a form , the friend fills the form in and the contents are logged in a database so it can be viewed by the user who sent the link.

 

i already have the link output ready thanks to some members in another thread, but i need to know how to make the page pick up the id. this is what i got so far:

 

<?php
if(!isset($id)) 
{
      echo "no id supplied";
}
if(isset($id)) 
{
echo '$id';
}

?>

 

unfortunately it echoes "no id supplied" even when i give an id.

hi, thanks for your help. i tried it and it echoed "$id" so i put an extra pair of single quotes around it and it worked.

like this:

if(!isset($_GET['id'])) 
{
      echo "no id supplied"
}else {
    $id = $_GET['id'];
}

if(isset($id)) 
{
echo ''.$id.'';
}

?>

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.