Good Day! I'm having a problem with this using sessions here are my problems
*When I tried to use session_start(); and error occured like this
Warning: open(/tmp\sess_2e57cbe4af9c8fc7535726456ad13470,O_RDWR) failed: No such file or directory (2) in c:\phpdev5\www\softlandia\login.php on line 3
*I can't get to the admin page it always direct me to the customer page even though i specified the location to the admin page
*One last thing.. I wanted to use a dialog box when prompting errors could you please help me
Thanks guys
CODE
<?php
ob_start();
include 'includes\connect.php';
require_once('includes\connect.php');
if(isset($_POST['Login'])){
$username=$_POST['username'];
$password=$_POST['password'];
if(empty($username)){
$problem=true;
$errors="<li>Empty Username</li>";
}
else if(empty($password)){
$problem=true;
$errors="<li>Empty Password</li>";
}
if(!$problem){
$query = "Select username,password from accounts where username ='$username' and password='$password'";
$result = mysql_query($query) or die(mysql_error());
if(mysql_num_rows($result)==0){
$errors="<li>Incorrect Username or Incorrect Password</li>";
}
else{
//Custome succesfully log in
header("Location: Customer.php");
}
}
else{
$query1 = "Select username,password from admin where username ='$username' and password='$password'";
$result1 = mysql_query($query1) or die(mysql_error());
if(mysql_num_rows($result1)==0){
$errors="<li>Incorrect Username or Incorrect Password</li>";
}
else{
//Admin succesfully log in
header("Location: Admin.php");
}
}
}
?>
[mod edit] How is it that someone is able to program, yet unable to use simple [ code ] tags?