Re: help getting web page
| From: | idban secandri | Date: | Thu, 29 Jun 2000 21:06:43 +0000 |
| Subject: | Re: help getting web page | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-3890@lists.php.net to get a copy of this message | ||
you mean like this?
<?
$file=fopen("http://test.atfantasy.com","r");
if (!$file) {
echo "error when connect\n";
exit;
}
while (!feof($file)) {
echo fgets($file, 1024);
}
?>
At 13:52 29/06/00 -0700, you wrote:
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))-- Doubt whom you will, but never yourself. http://php.klik.or.idecho fgets($fp,1024);?>