hi can ask for some help.. i already uploaded my site but my page stuck at login
here is my dbconnection code:
<?php
$lochost="localhost";
$username="root";
$password="";
$database="dbdelapaz";
mysql_connect($lochost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
?>
here is my log in code:
<?php
error_reporting(0);
session_start();
include("../include/dbConn.inc");
$userid = $_POST['txtUserID'];
$password2 = $_POST['txtPass'];
$sql = "SELECT * FROM tbluser WHERE UserID = '".$userid."' AND Password = '".$password2."' AND UserLevel='Administrator' OR UserLevel='PRINCIPAL'";
$result=mysql_query($sql);
$num=mysql_numrows($result);
$i1=0;
while ($i1 < $num)
{
$lname=mysql_result($result,$i1,"LastName");
$fname=mysql_result($result,$i1,"FirstName");
$mname=mysql_result($result,$i1,"MiddleName");
$picpath=mysql_result($result,$i1,"PicPath");
$i1++;
}
if($num == 1)
{
$_SESSION['authFac'] = 1;
$_SESSION['userid'] = $userid;
$_SESSION['uname'] = $fname." ".$lname;
$_SESSION['picpath1'] = $picpath;
header("Location: home.php");
}
else
{
header("location: invalid.html");
}
?>
can help me figure this out thanks...
here is my dbconnection code:
<?php
$lochost="localhost";
$username="root";
$password="";
$database="dbdelapaz";
mysql_connect($lochost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
?>
here is my log in code:
<?php
error_reporting(0);
session_start();
include("../include/dbConn.inc");
$userid = $_POST['txtUserID'];
$password2 = $_POST['txtPass'];
$sql = "SELECT * FROM tbluser WHERE UserID = '".$userid."' AND Password = '".$password2."' AND UserLevel='Administrator' OR UserLevel='PRINCIPAL'";
$result=mysql_query($sql);
$num=mysql_numrows($result);
$i1=0;
while ($i1 < $num)
{
$lname=mysql_result($result,$i1,"LastName");
$fname=mysql_result($result,$i1,"FirstName");
$mname=mysql_result($result,$i1,"MiddleName");
$picpath=mysql_result($result,$i1,"PicPath");
$i1++;
}
if($num == 1)
{
$_SESSION['authFac'] = 1;
$_SESSION['userid'] = $userid;
$_SESSION['uname'] = $fname." ".$lname;
$_SESSION['picpath1'] = $picpath;
header("Location: home.php");
}
else
{
header("location: invalid.html");
}
?>
can help me figure this out thanks...