Here is my code.
If you see some variables not defined, assume it is:
<?
require_once("fn_web.php");
require_once("fn_db.php");
set_time_limit(3000);
set_header("Auto-Update");
$final_result = get_records($_POST["key"]);
// getting the records from database
foreach ($final_result as $final)
{
$fp = @ fopen($final["url"], "r");
if (!$fp)
{
echo "<font color = \"#FF0000\">Error: URL <b><a href =
\"".$final["url"]."\"
target = \"blank\">".$final["url"]."</a></b> does not
exist.</font><br>";
}
else
{
// get rid of html tags
while (!feof($fp))
{
// do something to get rid of html tags
}
fclose($fp);
// find the $ sign
while ($counter < $i)
{
if ($buffer[$counter] == '$')
{
$counter++;
while (doubleval($buffer[$counter]) || $buffer[$counter]
== ".")
{
$price .= $buffer[$counter];
$counter++;
// $price_array_holder++;
}
//$price_array_holder = 0;
$price_count++;
}
else
$counter++;
}
if ($price_count > 1)
// more than one price found
{
echo "<font color = \"#FF0000\">Error: Multiple price found
for partnum <b>
<a href = \"".$final["url"]."\" target =
\"blank\">".$final["partnum"].
"</a></b>.</font><br>";
}
else if ($price_count == 0)
// no price has been found
{
echo "<font color = \"#FF0000\">Error: No price found for
partnum <b>
<a href = \"".$final["url"]."\" target =
\"blank\">".$final["partnum"].
"</a>.</font><br>";
}
else if ($price == $final["price"])
{
echo "<font color = \"#00A5C6\">No change has made for
partnum <b>
<a href = \"".$final["url"]."\" target = \"blank\">".
$final["partnum"]."</a></b>, price
remains".$price."</font><br>";
}
else
{
if (process_change($final["partnum"], $price, $vendor,
$final["url"]))
{
echo "<font color = \"#218429\">Update price to
".$price." for
partnum <b><a href = \"".$final["url"]."\" target =
\"blank\">".
$final["partnum"]."</a></b>.</font><br>";
}
}
flush();
}
}
set_footer();
?>
Tony S. Wu
[EMAIL PROTECTED]
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php