At the top there is
var $host = "localhost"; var $user = ""; var $pass = ""; var $db = "";
then later in the script there are lots of bits like this
function getCategories(){
$sql = "SELECT id, name, DATE_FORMAT(date, '".$this->date_format."') as newdate FROM ".$this->table_pre."categories AS categories ORDER BY id";
$items = mysql_query($sql) or die("Database Error: ".mysql_error());
while ($obj = mysql_fetch_object($items)) {
$array[$obj->id]['id'] = $obj->id;
$array[$obj->id]['name'] = $obj->name;
$array[$obj->id]['newdate'] = $obj->newdate;
}
mysql_free_result($items);
return $array;Are there any simple steps i can take to make this a bit safer? Some scripts I've used before use pear library with a db-connect include, I'm just thinking it may be wise to go down this route, but I think it would be quite a task to redo the whole script.
Is it safer if I extract the db name and pw to an include outside of the public html root?
Help
















