Re: Capturing Eval'd things into a variable...

From: Date: Mon, 27 Nov 2000 03:21:21 +0000
Subject: Re: Capturing Eval'd things into a variable...
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-27296@lists.php.net to get a copy of this message
Or just $variable = implode('', file("http://www.yourhost.com/path/to/tagetpage.php")); jason > I'm not sure I completely understand what you're trying to accomplish, but > it sounds like you want the html output of a php page captured to a > variable. Is that correct? > > Assuming it is, why not use fsockopen and make an http request for the page > directly. There are examples in the list archives which give examples, but > it would be something like (untested): > <?PHP > $tgt = "/path/to/targetpage.php"; > $host = "http://www.yourhost.com; > $header = "GET " . $tgt . " HTTP/1.0\r\n\r\n"; > $fp = fsockopen($host, 80, &$err_num, &$err_msg, 30); > if ($fp) { > // Send everything > fputs($fp, $header); > > // Get the response > while (!feof($fp)) { > $response = fgets($fp, 128); > $buf .= $response; > } > echo $buf; > } > > Hope this helps, > > Joe

« previous php.general (#27296) next »