Page 1 of 1

simple code

Posted: Thu Oct 13, 2005 3:51 am
by rami
i have a link
<a href="page.php?uid={$_row[user_id]}..............

my problem or query is how can i use that pass value ie data passed through uid ...for comparing ...
ie in page.php
i want select one thing when uid =1...
and some thing other when uid=2...and so on

i used 2 logic
if ($_GET[uid])==1)
select.....

and
$va=$_GET[uid]
if (va==1)
select ...

else

but i fail in both
it says undefined variable uid....

how can i do it?

Posted: Thu Oct 13, 2005 7:29 am
by Jenk
Hi, you should use the index key in the context according to it's type, i.e. you are referring to the key as a string, thus you need to reference it as you would a string:

Code: Select all

$_GET['uid']
HTH :)