Re: fsockopen to spit out the HTTP's Location...
| From: | Scott Fletcher | Date: | Tue, 23 Mar 2004 14:56:02 +0000 |
| Subject: | Re: fsockopen to spit out the HTTP's Location... | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-181266@lists.php.net to get a copy of this message | ||
In plain english, can't use the header("Location: ****"), so have to use the
fsockopen() instead. Just that header() is not allowed, don't ask me why.
Just couldn't get the browser perform the HTTP LOCATION event. It does work
when using fsockopen() for HTTP POST or GET as stated in the
http://us2.php.net/manual/en/function.fsockopen.php
with the user's comment.
What could be more difficult than this?
--snip--
$host = "192.168.0.2";
$port = 443;
$url_str = "ssl://www.whatever.com?str1=true&str2=false&str3=true";
$fp = fsockopen("ssl://".$host, $port, $errno, $errstr, $timeout = 30);
if(!$fp){
echo "$errstr ($errno)\n";
}else{
//send out to the browser.....
fputs($fp, "Location: ".$url_str."\r\n");
fclose($fp);
}
FletchSOD