Thread: Header converting & to & |
I am doing some basic website scraping and I have the following snippet:
Obviously this is not the site I am going to, but as an example. So the script then goes to Example Web Page instead. I tried urlencode/urldecode, but neither worked. Any ideas?Code:ob_start();
$str = "Location: http://www.example.com/?&id=001";
header($str);
ob_end_flush();
The url is wrong. If it's the first variable it does not require the "&" symbol. That is for something 'after' the first variable:
Should be:Code:Location: http://www.example.com/?&id=001
Example:Code:Location: http://www.example.com/?id=001
Code:Location: http://www.example.com/?id=001&iLove=BlaineSch
There are currently 1 users browsing this thread. (0 members and 1 guests)