delda
03-05-2008, 01:57 PM
O people of expert i have problem regarding a php script
server details as follow
windows server 2003 web edition
IIS6 modified to run php PHP 5.1.3
MySQL Server 5.0 NT
my problem as the following
i have php script runs locally very well on windowsXP WAMP package
the script runs very well with no issue
on the production server the problem happens
the breif of problem are
1 - the script connects to mysql database ( connection file is fine - database is accessible for user no issue with database)
2 - the main page of script is index.php ( user with login data user/password cannot request page directly - also server doesn't page
automaticaly and server returns the follwing url to client's browser http://x***********/m/cp/login.php?accesscheck=%2Fm%2Fcp%2Findex.php
3- i examined the login.php i found the code as follow's
heres the code snippet for brevity i removed html
<?php require_once('../Connections/connect.php'); ?>
<?php
// *** Validate request to login to this site.
session_start();
$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($accesscheck)) {
$GLOBALS['PrevUrl'] = $accesscheck;
session_register('PrevUrl');
}
if (isset($_POST['user'])) {
$loginUsername=$_POST['user'];
$password=$_POST['pass'];
$MM_fldUserAuthorization = "";
$MM_redirectLoginSuccess = "index.php";
$MM_redirectLoginFailed = "failed.php";
$MM_redirecttoReferrer = true;
mysql_select_db($database_connect, $connect);
$LoginRS__query=sprintf("SELECT user, pass FROM msn_admin WHERE user='%s' AND pass='%s'",
get_magic_quotes_gpc() ? $loginUsername : addslashes($loginUsername), get_magic_quotes_gpc() ? $password : addslashes($password));
$LoginRS = mysql_query($LoginRS__query, $connect) or die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);
if ($loginFoundUser) {
$loginStrGroup = "";
//declare two session variables and assign them
$GLOBALS['MM_Username'] = $loginUsername;
$GLOBALS['MM_UserGroup'] = $loginStrGroup;
//register the session variables
session_register("MM_Username");
session_register("MM_UserGroup");
if (isset($_SESSION['PrevUrl']) && true) {
$MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
}
header("Location: " . $MM_redirectLoginSuccess );
}
else {
header("Location: ". $MM_redirectLoginFailed );
}>}
?>
4- if i supply user name and password correctly nothing happens and nor server redirect me to failed.php just
returns the following header value http://x***********/m/cp/login.php?accesscheck=%2Fm%2Fcp%2Findex.php
where should i do to fix the problem
is it an issue with php.ini
or is it an issue with IIS
or is it a of script itself even its running okay on local WAMP boxes
server details as follow
windows server 2003 web edition
IIS6 modified to run php PHP 5.1.3
MySQL Server 5.0 NT
my problem as the following
i have php script runs locally very well on windowsXP WAMP package
the script runs very well with no issue
on the production server the problem happens
the breif of problem are
1 - the script connects to mysql database ( connection file is fine - database is accessible for user no issue with database)
2 - the main page of script is index.php ( user with login data user/password cannot request page directly - also server doesn't page
automaticaly and server returns the follwing url to client's browser http://x***********/m/cp/login.php?accesscheck=%2Fm%2Fcp%2Findex.php
3- i examined the login.php i found the code as follow's
heres the code snippet for brevity i removed html
<?php require_once('../Connections/connect.php'); ?>
<?php
// *** Validate request to login to this site.
session_start();
$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($accesscheck)) {
$GLOBALS['PrevUrl'] = $accesscheck;
session_register('PrevUrl');
}
if (isset($_POST['user'])) {
$loginUsername=$_POST['user'];
$password=$_POST['pass'];
$MM_fldUserAuthorization = "";
$MM_redirectLoginSuccess = "index.php";
$MM_redirectLoginFailed = "failed.php";
$MM_redirecttoReferrer = true;
mysql_select_db($database_connect, $connect);
$LoginRS__query=sprintf("SELECT user, pass FROM msn_admin WHERE user='%s' AND pass='%s'",
get_magic_quotes_gpc() ? $loginUsername : addslashes($loginUsername), get_magic_quotes_gpc() ? $password : addslashes($password));
$LoginRS = mysql_query($LoginRS__query, $connect) or die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);
if ($loginFoundUser) {
$loginStrGroup = "";
//declare two session variables and assign them
$GLOBALS['MM_Username'] = $loginUsername;
$GLOBALS['MM_UserGroup'] = $loginStrGroup;
//register the session variables
session_register("MM_Username");
session_register("MM_UserGroup");
if (isset($_SESSION['PrevUrl']) && true) {
$MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
}
header("Location: " . $MM_redirectLoginSuccess );
}
else {
header("Location: ". $MM_redirectLoginFailed );
}>}
?>
4- if i supply user name and password correctly nothing happens and nor server redirect me to failed.php just
returns the following header value http://x***********/m/cp/login.php?accesscheck=%2Fm%2Fcp%2Findex.php
where should i do to fix the problem
is it an issue with php.ini
or is it an issue with IIS
or is it a of script itself even its running okay on local WAMP boxes
