January 1st, 2013, 08:29 AM
Pass variable in link from one PHP page to another
So, I will go directly to the problem. I'm trying to pass a variable with a URL like this:
where the variable $link2 is a link to an image. This works fine, the problem is when I'm trying to use $_REQUEST in editImage.php to catch the variable.
echo "<a href='editImage.php?liink=$link2'>Edit</a>";
In editImage.php I do this:
But $liink does not receive a value, it's empty. After this I just want to put the variable in a query and execute the query. When doing this I get this message from the browser:
$liink = $_REQUEST["liink"];
where line 20 is the above REQUEST line. I have also tried this with $_GET but it's not working.
Notice: Undefined index: liink in /path/editImage.php on line 20
I have searched on the forum and on google but I can't solve this one. Please help me, I would appreciate it so much.
January 1st, 2013, 09:45 AM
$_GET is the right variable to use. Make sure the URL contains what you expect.
Last edited by gw1500se; January 1st, 2013 at 09:48 AM.
There are 10 kinds of people in the world. Those that understand binary and those that don't.