Hey all
For some reason the webserver I have don't like my connection code because I can't get access to my database at all.
I know that the provider has put register_globals = off and I'm not sure if it's possible to change, because I have had to change a lot of code to make the site work with register_globals at off.
In the top of the code in my index.php is this:
<?
include ("common.php");
connectDatabase();
?>
Common.php includes this:
<?
$dbHost = "";
$dbUser = "";
$dbPass = "";
$dbName = "";
function connectDatabase()
{
global $dbHost, $dbUser, $dbPass, $dbName;
if (!($link = @mysql_connect($dbHost, $dbUser, $dbPass))) exit("Couldn't connect to database server");
if (!@mysql_select_db($dbName)) exit("Couldn't select $dbName database");
}
?>
The way I see it it should work quite fine - which it also does when I view it locally, but the problems come when I upload it to the webserver. Anyone have an idea why?
/// NetRoam