Hey all ... Im trying to write some code but getting errors and its really getting to me ... Can someone please help.
The code goes to my wholesaler website ... grabs the description of the item ... and the price ... Then adds 25% to the price and prints it out ... But im getting an error msg:
Warning: stat failed for Resource id #1 (errno=2 - No such file or directory) in /home/virtual/site60/fst/var/www/html/nsi/html/notebook_accesories.php on line 137
Line 137 is:
$table=fread($url, filesize($url));
Also im getting another error:
Warning: Invalid argument supplied for foreach() in /home/virtual/site60/fst/var/www/html/nsi/html/notebook_accesories.php on line 139
Line 139 is:
foreach($table as $temp){
Ok ... Heres the entire PHP code ... If someone could help me ... That would be greatly appreciated:
<?
$URL="http://www.altech.com.au/price/price_goodlist.asp?shop=S&type=3";
$url=fopen($URL, "r");
$table=fread($url, filesize($url));
fclose($url);
foreach($table as $temp){
ereg("(<tr>)(.)(</tr>$))", $temp, $prizes);
if(ereg("#F9F9F9", $temp)){
ereg_replace("(<a)(.)(>$)", "", $temp);
ereg_replace("</a>", "", $temp);
ereg("(<td)(.)(</td>$)", $temp, $rows);
print "$rows[2]";
ereg(">[[:digit:]]<", $rows[3], $prizes);
$prizes= (int) $prize+((int) $prize*15)/100;
ereg_replace(">[[:digit:]]<", $prize, $rows[2]);
print "$rows[2]";
print "</tr>\n<tr>";
}
}
?>