<?php  ob_start();
session_start();
include("config.php");

$userid=$_POST[userid];
$password=$_POST[password];

if(($userid!="")&&($password!="")){

$pass_hash = md5($password);


$result=mysql_query("select * from user WHERE userid='$userid' and password='$pass_hash' ");
$row=mysql_fetch_array($result);

if($row!=""){
$_SESSION[invcox]=$row[userid];
$_SESSION[userid]=$row[userid];

$_SESSION[admin]=$row[userid];
$_SESSION[uid]=$row[id];
header("location:index.php");

}else{
	
	header("location:login.php?action=error");
}
}else{
	header("location:login.php?action=error");
}
?>