$_GET does not work when one of the parameters to the page is a url.
An external page (which I do not have control on) shows an iframe to my page and it passes parameters of which one is:
turkSubmitTo=http%3A%2F%2Fwww.mturk.com
When on my page I want to extract other parameters, it gives me NULL for everything, but when I remove the “http” it works. Why is that and what can I do to get the other parameters?
EDIT:
You can try it yourself here:
http://www.translate.outofscopes.com/?turkSubmitTo=http%3A%2F%2Fwww.mturk.com
The Array() down there is a print_r of $_GET, you can try to remove the ‘http’ in the parameter and it will work.
On the localhost it works perfectly.
Try Something like:
$parameters = array(); if (isset($_SERVER['QUERY_STRING'])) { $pairs = explode('&', $_SERVER['QUERY_STRING']); foreach($pairs as $pair) { $part = explode('=', $pair); $parameters[$part[0]] = urldecode($part[1]); } }