It didn't post right. It should work this time.
The actuall error we get is this:
Parse error: parse error, expecting `')'' in /home/the-node/public_html/cheats/load.php on line 16
<?php
ParseFiles();
function GetFiles($dir) {
exec("ls " . $dir . " -1", $files);
return $files;
}
function ParseFiles()
{
$directories[] = array ("dc", "n64", "psx", "psx2");
$i;
for($i = 0; $i < 4; i++) {
$files = GetFiles($directories);
$i2;
for($i2 = 0; $i2 <= count($files) - 1; i2++) {
$filename = $files[i];
$filepointer = fopen($directories[i] . $filename, 'r');
$fileread = fread($filepointer, filesize($filename));
fclose($filepointer);
$titlestart = strpos($fileread, "<h1>");
$titleend = strpos($fileread, "</h1>");
$title = substr($fileread, $titlestart, $titleend);
strip_tags($title);
trim($title);
$bodypos = strpos($fileread, "<!--BODY-->");
$body = substr($fileread, $bodypos);
$body = strip_tags($body, "<table>, <tr>, <td>, <b>, <i>, <li>, <u>");
$dbName = "thenode_news";
$dbPass = "the";
$dbUserName = "thenode_newsy";
$host = "localhost";
$base = "the-node.com";
$db = mysql_connect($host, $dbUserName, $dbPass) or die ("Could not connect");
mysql_select_db($dbName,$db);
$today = gmdate ( "M d Y H:i:s" );
$query = "INSERT INTO $directories[i] (body, title, date, user_id) VALUES ('$body', '$title', '$today', 'Auto-Add')"
$result = mysql_query($sql);
if (!$result) {
echo"Error! ", mysql_error();
exit;
} else {
echo"successfully added $directories[i]/$filename<br>\n";
}
}
unset($files);
}
}
?>