Re: fsockopen to spit out the HTTP's Location...
| From: | Michal Migurski | Date: | Tue, 23 Mar 2004 17:07:14 +0000 |
| Subject: | Re: fsockopen to spit out the HTTP's Location... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-181281@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.
>--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);
>--snip--
> //send out to the browser.....
> fputs($fp, "Location: ".$url_str."\r\n");
That won't get sent to the browser, it will get sent to 192.168.0.2, which
is (I guess) some machine behind your router. You can't initiate a TCP
connection -- what fsockopen does -- with the client's machine.
I'll ask even though you said not to - Why doesn't header() work?
---------------------------------------------------------------------
michal migurski- contact info and pgp key:
sf/ca http://mike.teczno.com/contact.html