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!

Recommended Answers

Do you have a button on form submit sending those values.

Maybe:
http://www.tizag.com/phpT/postget.php

Jump to Post

What is the error?

Jump to Post

All 5 Replies

What is the error?

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

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

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!!!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.