Code : Tout sélectionner
if ($PID == 2681){require('http://www.myste.info/linksphp/html/page2681.htm');}1er pb : on m'a dit qu'il ne fallait pas faire comme çà mais avec ceci :
Code : Tout sélectionner
$handle = fopen ('http://www.myste.info/linksphp/html/page2681.htm', "rb");
do {
$data = fread($handle, 8192);
if (strlen($data) == 0) {
break;
}
$myLine .= $data;
} while(true);
fclose ($handle);
if(empty($myLine))
{ echo "error fetching";exit;
}
// $myLine now has the entire page, possibly you only want a
// portion of the page, to do that you need to find somthing
// in the code that is unique before and after the text.
// You'll have to view the html source of what you are
// fetching to get it perfect. To get everying within
// a simple a table, might look like this.
$start = '<table><tr><td>';
$end = '</td></tr></table>';
$start_position=strpos($myLine, $start);
$end_position=strpos($myLine, $end)+strlen($end);
$length=$end_position-$start_position;
$myLine=substr($myLine, $start_position, $length);
// you can strip out or alter other stuff if needed
// replace one string with another
$myLine=ereg_replace("95%", "90%", $myLine);
//get rid of html , except for italics & bold
$myLine=strip_tags($myLine, '<i>', '<b>');
}