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
Share on other sites

Thanks. Now there is a new error.

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/virtu857/public_html/aandwtechsupport.co.cc/login_process.php on line 10

 

Line 10:

if(mysql_num_rows($result) == 1){

Link to comment
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
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.