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
https://forums.phpfreaks.com/topic/94724-authentication-php-page-not-working/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.