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.

Link to comment
Share on other sites

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.'';
}

?>

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.