Hello,
There is an error in my login script and I can't figure out what it is...
I believe it might be my "SELECT" statement...
Can anyone help me?
Code: <?php
//define ('SASI Services Portal');
//check if user is logged in
$loggedin==0;
if(isset($_POST['username']))
{
$loggedin=FALSE; //the user is not currently logged in
//so, open the mysQL database
//create the connection
$con=mysql_connect("localhost", "xxxx", "xxxx");
if(!$con)
{
die('Could not connect: ' .mysql_error());
}
mysql_select_db("my_SASI", $con);
$result= mysql_query("SELECT * FROM logins, users WHERE logins.loginID=users.userID AND Email_Address='".$_POST['username']."' AND password='".$_POST['password']."' AND accessLevel=1");
while($row=mysql_fetch_array($result))
{
session_start(); //start a new session
$_SESSION['username']=$_POST['username'];
$_SESSION['password']=$_POST['password'];
$_SESSION['firstname']=$row['FirstName'];
$_SESSION['lastname']=$row['LastName'];
$_SESSION['accesslevel']=$row['accessLevel'];
$loggedin=TRUE;
}
}
if($loggedin && $_SESSION['accesslevel']==0)
{
header('Location: student_admin.php');
exit();
}
if($loggedin && $_SESSION['accesslevel']==1)
{
header('Location: teacher_admin.php');
exit();
}
mysql_close($con);
?>
MySQL-PHP Query Results Help
Hello all. I'm hoping to be able to get some help in solving a problem with query/rowcount output. I've been learning PHP and mySQL for about 7 months now and have several successful Mods
what does this mean? +=
is anyone able to explain what this code is saying?i had it written for me awhile back and now that i wanna change it about to make it my own etc i dont really know what each part is doing...
pass form variables straight to email, no database required?
hello all,im working on this form...http://www.adobedayevents.com/project_request/project_request.phpWhat we want to use this form for, is for our client Adobe, to have there field marketing managers
fire away
i launched about 4 months ago as a lagit co. i have 2 paying clients, 1probono, 1 side progect, and 1 chat site. all of this has led to a lot of hits but very few real clients. i just changed from a
Reg Ex
Im trying to search for the string: srv_9 (Dead ???)I thought to use preg_match, however I dont know much about reg ex. Can anyone help? Thankks
PHP Cannot redeclare class
I have 6 files, and two of them do not seem to want to play well. I keep getting a "Cannot redeclare class" error.** edit **I know its these 2 files, because when i comment out the
php multiple action on submit
I have a form which says:<form enctype='multipart/form-data' method='post' action='process.php' target='_blank'>I need to call process.php on submit or on clicking submit button. Now
How do I create a 2D game "camera" to follow player?
In J2ME programming I'm targeting MIDP 2.0 devices.I'm using gamecanvas and I was thinking that I could create my full world (640 x 480) using a TiledLayer and then set the refpixel of the TilerLayer
Running a cron job through PHP/Apache?!
Hello all,I have a PHP script which makes a cron file from user input. When i try to run the cron job via system() the job doesn't run, I suspect it has something to do with permissions. Any ideas on
FPDF Help
I've been playing with the FPDF module. I was building a form and rolling right along and then suddenly I started getting the "FPDF error: Some data has already been output, can't send PDF