0

hello everybody, it's my first time to ask on forums with hope of your very useful support.
I have difficulty to access the value of my variable which i set in other page of anchor tag. here the code is;

echo '<li><a  title="' . $row['hot_name'] . '" href="1hot.php"?pg= "2">' .$row['hot_name'] . '</a></li>' ;

I retrieved and displayed the 'pg' index like this;

<?
$variable = $_GET['pg'];
echo $variable;
?> 

I hoped to see 2 on the screen but what appears is just an error. can u pls help on it? thank you so much!

4
Contributors
5
Replies
7
Views
5 Years
Discussion Span
Last Post by robanatilahun
0

i have no form and the error is:

Notice: Undefined index: pg in C:\xampp\htdocs\visithawassa\1hot.php on line 6

thank you again

0

href="1hot.php"?pg= "2">'

try changing that to href="1hot.php?pg=2" or escape the quotation marks if you don't want to use POST

0

href="1hot.php?pg=2"

thank you very much my friend. i changed it and it WORKED!!!!!!!!!!! u have no idea how u make my life esier!!!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.