Jump to content

Urgent! My login page no longer works after transferring hosts


GreeneStreet

Recommended Posts

So last week our company decided to migrate our website to a new server and after doing so we noticed one key element has stopped working- our login!

php.5.3

apache 2.3.3

 

The files are the exact same- the SQL database is the exact same- but once the correct login information is input the page just loads to: http://198.154.221.208/login.php?accesscheck=%2Fsubscribers%2Fgetting-started.php

instead of http://198.154.221.208/subscribers/getting-started.php

 

We know that it correctly recognizes that the user has permissions because if we enter the incorrect password or just bogus information period- it brings us to the failed login page: http://198.154.221.208/login.php?access=failed

 

So without further adieu, here's the code:

 

<?php require_once('Connections/dbconnec.php'); ?>
<?php
// *** Validate request to login to this site.
if (!isset($_SESSION)) {
 session_start();
}

$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($_GET['accesscheck'])) {
 $_SESSION['PrevUrl'] = $_GET['accesscheck'];
}

if (isset($_POST['email'])) {
 $loginUsername=$_POST['email'];
 $password=$_POST['password'];
 $MM_fldUserAuthorization = "prilevel_id";
 $MM_redirectLoginSuccess = "/subscribers/getting-started.php";
 $MM_redirectLoginFailed = "login.php?access=failed";
 $MM_redirecttoReferrer = false;
 mysql_select_db($database_dbconnec, $dbconnec);

 $LoginRS__query=sprintf("SELECT cust_email, cust_password, prilevel_id, acctexp_date FROM customers WHERE cust_email='%s' AND cust_password='%s' AND acctexp_date >= CURDATE()",
 get_magic_quotes_gpc() ? $loginUsername : addslashes($loginUsername), get_magic_quotes_gpc() ? $password : addslashes($password));

 $LoginRS = mysql_query($LoginRS__query, $dbconnec) or die(mysql_error());
 $loginFoundUser = mysql_num_rows($LoginRS);
 if ($loginFoundUser) {

   $loginStrGroup  = mysql_result($LoginRS,0,'prilevel_id');

   //declare two session variables and assign them
   $_SESSION['MM_Username'] = $loginUsername;
   $_SESSION['MM_UserGroup'] = $loginStrGroup;

   if (isset($_SESSION['PrevUrl']) && false) {
     $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
   }
   header("Location: " . $MM_redirectLoginSuccess );
 }
 else {
   header("Location: ". $MM_redirectLoginFailed );
 }
}
?>

 

I'm not really very familiar with PHP or SQL so much as HTML and CSS so this is all still kind of foreign to me- SO I bring it before the community....

Link to comment
Share on other sites

Here's the rest of the code for the page btw

 

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/defaultv2.dwt.php" codeOutsideHTMLIsLocked="false" -->

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<!-- InstanceBeginEditable name="doctitle" -->

<title>Fix Your Persistency</title>

<!-- InstanceEndEditable -->

<link href="stylesv2.css" rel="stylesheet" type="text/css" />

<!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->

</head>

 

<body>

<div id="page">

<div id="header"><a href="http://fixyourpersistency.com/index.php">Home</a> | <a href="http://fixyourpersistency.com/login.php">Login</a> | <a href="http://fixyourpersistency.com/services.php">Services</a> |<a href="http://fixyourpersistency.com/contact-us.php"> Contact Us</a></div>

 

<div id="banner"></div>

 

<div id="menu"><!-- InstanceBeginEditable name="menu" --><!-- InstanceEndEditable --></div>

<div id="content"><!-- InstanceBeginEditable name="content" -->

<h1>Login

</h1>

<?php if ($_GET['access'] == 'failed') { // IF LOGIN FAILS?>

<div class="error-block">

<h1>Access not granted</h1>

<p>Please check your email address and password. </p>

<p><a href="forgotpassword.php">Forgot Your Password?</a> </p>

<p>If you feel you are receiving this message in error please <a href="contact-us.php">contact us</a>. </p>

</div>

<?php }

if (isset($accesscheck)) { // IF TRIED TO ACCESS RESTRICTED PAGE

echo '<div class="error-block">You must login to access that page. </div>' ;

}

; ?>

<form ACTION="<?php echo $loginFormAction; ?>" method="POST" name="login" id="login">

<table border="0">

<tr>

<td align="right">Email Address: </td>

<td><input name="email" type="text" id="cust_email" /></td>

</tr>

<tr>

<td align="right">Password:</td>

<td><input name="password" type="password" id="password" /></td>

</tr>

<tr>

<td align="right"> </td>

<td><input type="submit" name="Submit" value="Login" /></td>

</tr>

<tr align="center">

<td colspan="2"><a href="v2/forgotpassword.php">Forgot your password?</a></td>

</tr>

</table>

</form>

<!-- InstanceEndEditable --></div>

 

<div id="footer"><span class="footer"><a href="http://fixyourpersistency.com/index.php">Home</a> | <a href="http://fixyourpersistency.com/login.php">Login</a> | <a href="http://fixyourpersistency.com/services.php"> Services</a> | <a href="http://fixyourpersistency.com/contact-us.php">Contact Us</a> | <a href="http://fixyourpersistency.com/privacy.php">Privacy Statement</a> | <a href="http://fixyourpersistency.com/termsofuse.php">User Agreement</a></span></div>

<div id="disclaimer">FixYourPersistency.com is a Decko Enterprises, LLC company and is in no way affiliated with Primerica Financial Services or any Primerica Financial Services company or subsidiary.</div>

<div id="pageFooter"><div id="siteCopy"><script src="ScriptLibrary/copyright.js">

</script> Decko Enterprises, LLC. All rights reserved.</div>

<div id="wnmg-logo">

<a href="http://www.webnetmediagroup.com" target="_blank"><img src="images/webnet-dark.gif" width="112" height="30"

alt="Powered by WebNet Media Group" border="0" /></a>

</div>

</div>

 

 

</div>

</body>

<!-- InstanceEnd --></html>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.