PureMisery
12-30-2005, 05:13 AM
This is based off of a tut I read, http://www.devhome.org/php/tutorials/webcatching.html
The problem I'm having is with the $search function. The quotation marks in the font code that I need the script to search between are causing an error message "Parse error: parse error, unexpected T_LNUMBER in line 25"
Line 25 is $search = eregi("<td><font size="1"><font color="#FFFFFF"><span style="font-weight:normal;">(.*)</span></td>", $read, $money);
Is there another way to format it so that it will work correctly?
<?
$id = $_REQUEST['id'] ;
if (!isset($_REQUEST['id'])) {
?>
<html>
<head>
<title>Id Page</title>
</head>
<body bgcolor="black" text="green">
<form method="post" action="outwarid.php">
ID: <input name="id" type="text" ><br>
<input type="submit">
</form>
</body>
</html>
<?
}
else {
$open = fopen("http://torax.***********/id.php?id=$id", "r");
$read = fread($open, 15000);
fclose($open);
$search = eregi("<td><font size="1"><font color="#FFFFFF"><span style="font-weight:normal;">(.*)</span></td>", $read, $money);
$money[1] = str_replace("<br>","", $money[1]);
$content = $money[1];
$content = explode("·", $content);
$headlines = sizeof($content);
for ($i = 0; $i < $headlines; $i++) {
print "Money: $content[$i]";
}
}
?>
<html>
<head>
<title>Test Page</title>
</head>
<body bgcolor="black" text="green">
</body>
</html>
The problem I'm having is with the $search function. The quotation marks in the font code that I need the script to search between are causing an error message "Parse error: parse error, unexpected T_LNUMBER in line 25"
Line 25 is $search = eregi("<td><font size="1"><font color="#FFFFFF"><span style="font-weight:normal;">(.*)</span></td>", $read, $money);
Is there another way to format it so that it will work correctly?
<?
$id = $_REQUEST['id'] ;
if (!isset($_REQUEST['id'])) {
?>
<html>
<head>
<title>Id Page</title>
</head>
<body bgcolor="black" text="green">
<form method="post" action="outwarid.php">
ID: <input name="id" type="text" ><br>
<input type="submit">
</form>
</body>
</html>
<?
}
else {
$open = fopen("http://torax.***********/id.php?id=$id", "r");
$read = fread($open, 15000);
fclose($open);
$search = eregi("<td><font size="1"><font color="#FFFFFF"><span style="font-weight:normal;">(.*)</span></td>", $read, $money);
$money[1] = str_replace("<br>","", $money[1]);
$content = $money[1];
$content = explode("·", $content);
$headlines = sizeof($content);
for ($i = 0; $i < $headlines; $i++) {
print "Money: $content[$i]";
}
}
?>
<html>
<head>
<title>Test Page</title>
</head>
<body bgcolor="black" text="green">
</body>
</html>