Jump to content

Please help


dudejma

Recommended Posts

I get this error:

Parse error: syntax error, unexpected '}' in /home/virtu857/public_html/aandwtechsupport.co.cc/login_process.php on line 36

 

This is my code:

<?php
session_start();

include('connections/systems.php');

// Username and the password from form, and protected from MySQL injection
$email = mysql_real_escape_string(stripslashes($_POST['email']));
$password = mysql_real_escape_string(stripslashes($_POST['password']));
$result = mysql_query("SELECT * FROM users WHERE email='$email' and password='$password'");
if(mysql_num_rows($result) == 1) 
// If query returned 1 row{    
// Register nessecary sessions.    
session_register("email"); // It would be wise to do $_SESSION['email'] = $email;    
session_register("password");    

if ($level == "1")    
{       
     header("location: client.php");    
}    
else if ($level == "2")    
{        
     header("location: staff.php");    
}     
else if ($level == "3")    
{       
     header("location: techadmin.php");    
}    
else if ($level == "4")    
{         
     header("location: admin.php");    
}    
else    
{        
     header("location: login.php");    
}
}
?>

 

Line 36:

 }

 

Thanks for any help!

Link to comment
https://forums.phpfreaks.com/topic/207769-please-help/
Share on other sites

or you can do what i do is change your query line into 2 lines...

 

$sql = "SELECT * FROM users WHERE email='".$email."' AND password='".$password."'";

$result = mysql_query($sql);

 

but then commenting out the $result (or not even) and adding in: echo $sql; to verify that the query itself has the wanted information.

Link to comment
https://forums.phpfreaks.com/topic/207769-please-help/#findComment-1086549
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.