I am using my admin panel login script where i have created a global.php file with code including this:-
<?php
$Global['host']="localhost";
$Global['username']="username";
$Global['password']="*******";
$Global['database']="database_name";
$Global['baseurl']='www.somesite.com/work/';
$connhandle=mysql_connect($Global['host'],$Global['username'],$Global['password'])or die('can\'t establish connection with mysql database');
$dbSelect=mysql_select_db($Global['database'],$connhandle) or die('could not connect to the database');
?>
and for calling the script on clock i m using a redirect.php file which include code as follows:-
<?php
session_start();
$_SESSION['username'] = $_POST['user'];
$_SESSION['password'] = $_POST['pass'];
$_SESSION['aid'] = 0;
include 'global.php';
$admin_themes=mysql_fetch_object(mysql_query("select * from admin where id='1'"));
$ruser = $admin_themes->username;
$rpass = $admin_themes->password;
if ($_SESSION['username'] == $ruser && $_SESSION['password'] == $rpass) {
$_SESSION['aid'] = 1;
header("location:../index.php");
}
else {
header("location:../admin_login.php?passcheck");
}
?>
no this scripts in working absolutely fine when i run this using my xampp server on local. but when i upload it to my online server the redirect script show me this error:-
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'username'@'localhost' (using password: YES) in /home/..../public_html/work/h_cms/configuration/global.php on line 9 can't establish connection with mysql database
any suggestion why its not showing on online server i have used the correct username and pass of my database i have checked it 5 times. But still not find where is the problem.