Jump to content

Authentication PHP page not working!


jonw118

Recommended Posts

I am in the process of moving my site... on my new server I've hit a problem.

 

I have an admin side that requires a user/pass. When you login it takes you authentication.php. It as this point things get stuck.

 

Here is the code for that page:

 

<?
//starting session
error_reporting(E_ALL ^ E_NOTICE);
session_start();
include_once("inc/dbConn.php");
$db=new dbConnection;
$conn=$db->connection();
//authenticating login id and password
$user = $_POST['txtlogid'];
$passwd = $_POST['txtpwd'];
$sql = "SELECT * FROM tbl_member WHERE (mem_name = '$user'  AND mem_pass = '$passwd'  )";
$result = mysql_query($sql) or die(mysql_error());
	if(mysql_num_rows($result)>0) {
	 $Row = @mysql_fetch_array($result);
	 $my_adminid = $Row["mem_ID"];   
		 session_register("my_adminid");
	 $_SESSION['my_adminid']=$my_adminid;
	header("location: index.php");   
	 }
else
	{
	header("location: login.php?fail=1");  

	}
?>

 

Here is the error I get when I type in my user/pass and it stalls on the page:

 

connection(); //authenticating login id and password $user = $_POST['txtlogid']; $passwd = $_POST['txtpwd']; $sql = "SELECT * FROM tbl_member WHERE (mem_name = '$user' AND mem_pass = '$passwd' )"; $result = mysql_query($sql) or die(mysql_error()); if(mysql_num_rows($result)>0) { $Row = @mysql_fetch_array($result); $my_adminid = $Row["mem_ID"]; session_register("my_adminid"); $_SESSION['my_adminid']=$my_adminid; header("location: index.php"); } else { header("location: login.php?fail=1"); } ?>

 

Any help would GREATLY appreciated!

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.