This might be a simple question but now i started working on GET method so I’m kinda new to it.
I have some images which are given some unique ids:
<a href="imageid.php?id=" . $b . "><imagetag></a>;
$b is the variable that stores the ID of the image.
Now I want to pass the $b variable value to imageid.php.
The link successfully opened imageid.php in my browser but the URL looks like imageid?id=. It does not display the id in the URL.
I also tried doing this:
echo $_GET['id']; // in my imageid.php
… but it’s not printing the id that I just passed to imageid.php using the GET method? Why?
There isn’t really enough information in your question to give a full answer, but have you checked that $b is really holding the image ID? Also, are you side “echo $var = $_GET[‘id’];” wouldn’t just echo whether or not $var was assigned to? (i.e. false or true).
Please provide the full code so I can reply with a better answer.