Hello
I have problems with fopen
On a server with php 4.3.7 and rh7.2 when I execute this
simple php grabber (yahoo is only an example) to grab
a full web page from <html> to </html>
<?
$fbileb = fopen("http://www.yahoo.com", "r");
$rfb = fread($fbileb, 150000);
$grabb = eregi("<html(.*)/html>", $rfb, $printingb);
$bandb = $printingb[1];
echo "$bandb";
?>
infact it returns (echo "$bandb"😉 all yahoo homepage .
Well , on another server rh7.3 with php 4.3.8 when I execute the same code above I receive a blank page (!).
Only if I grab few lines for example <title></title> instead of
<html> to </html> it works fine .
Any idea ? Why fopen doesn't work my other server ?
And do you know an alternative way to grab text in a web page (from.. to...) without using fopen ? I have found a way using curl
//the site or URL to get
$ch = curl_init("http://www.yahoo.com/");
//set the options for the transfer
curl_setopt($ch, CURLOPT_HEADER, 0);
//execute the session
curl_exec($ch);
//free up system resources !!IMPORTANT
curl_close($ch);
but I cannot find to show only what I need for example from <title> to </title> . ANy help ?
Thank you!