Re: help getting web page
| From: | Robert V. Zwink | Date: | Thu, 29 Jun 2000 21:13:11 +0000 |
| Subject: | Re: help getting web page | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-3893@lists.php.net to get a copy of this message | ||
Doesn't name-based virtual hosting require an HTTP1.1 compliant browser?
You might need to send addition information in the header to the host that
you are requesting. I don't believe fopen would emulate a true http1.1
compliant request.
I beleive the only way apache knows what domain is being requested
(test.atfantasy.com or new.atfantasy.com) is by looking for information in
the requesting header.
I believe the header Apache looks for is called "Host" I am unsure of the
syntax to send additional headers before a GET request.
Hope this helps,
Robert Zwink
http://zwink.levitate.org
----- Original Message -----
From: "Ed Lazor" <osmosis@atfantasy.com>
To: <php-general@lists.php.net>
Sent: Thursday, June 29, 2000 4:52 PM
Subject: [PHP] help getting web page
>
> The following code isn't working properly. Instead of pulling up
> test.atfantasy.com, it pulls up new.atfantasy.com. They are both virtual
> domains running on the server. I'm assuming that I need to somehow
specify
> which domain I'm requesting information from. Any ideas?
>
> Thanks =)
>
> ps... if there's another way to do this, I'm all ears hehe I'm trying to
> pull a web page and store it into a variable with the intention of then
> mailing it to myself as kind of a status update.
>
> --------------------------------------------------
>
> <?php
>
> print "HERE WE ARE TESTING<br>";
>
> $fp = fsockopen("test.atfantasy.com", 80);
> $command = "";
> fputs($fp,"GET /$command HTTP/1.0\r\n\r\n");
>
> while(!feof($fp))
> echo fgets($fp,1024);
>
>
> ?>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>