Hello, I'm trying to wite a script that parses an .HTML page and formats its output to a file. I havent worked but 10 - 20 hours with PHP. This is the script:
The error I'm getting is:PHP Code:<?
$matches[100];
$string;
$output = "/home/tarts/public_html/test/file.txt";
$file1;
fopen($rh, 'r');
if (!$file1 = fopen($output, 'w+')) {
echo "Cannot open file $output.\n";
exit;
}
if (!$string = file_get_contents("https://rhn.redhat.com/errata/rh9-errata-security.html")) {
echo "Unable to read file $file.\n";
exit;
}
if (!preg_match_all("200", $string, $matches, PREG_SET_ORDER)) {
echo "No matches, bad regex.\n";
exit;
}
if (!fwrite($file1, $matches)) {
echo "Unable to write to file $file1.\n";
exit;
}
if (!fclose($file1)) {
echo "There has been an error, unable to close $file1.\n";
exit;
}
echo "SUCCESS!\n";
exit;
?>
If anyone could help me with that error and also give a few general pointers on how to implement this I'd be happy to hear it.Code:Warning: Delimiter must not be alphanumeric or backslash in /home/tarts/public_html/redhat.php on line 15 No matches, bad regex.
Thanks!





Bookmarks