みんな助けてください!!
なぜログインできないのか、これはエラーです: *致命的なエラー: C:\xampp\htdocs**\proses1.php の 27 行目の未定義関数 session_register() への呼び出し*
この proses1.php コード:
<?php
include "connect.php";
$username= $_POST['username'];
$password= $_POST['password'];
if (!$_POST['username'] | !$_POST['password'])
{
print "<script>alert('isi username dan password anda!');
javascript:history.go(-1);</script>";
exit;
}
$username = stripslashes($username);
$password = stripslashes($password);
$username = mysql_real_escape_string($username);
$password = mysql_real_escape_string($password);
$sql="SELECT login.username, login.password, login.status FROM login WHERE
login.username='$username' AND login.password='$password'";
$result=mysql_query($sql) or die(mysql_error());
$count=mysql_num_rows($result);
// If result matched $myusername and $mypassword, table row must be 1 row
$r=mysql_fetch_array($result);
session_start();
session_register("username");
session_register("password");
session_register("status");
//session_register("nojual");
$_SESSION['username']=$r[username];
$_SESSION['password']=$r[password];
$_SESSION['status']=$r[status];
//$_SESSION['nojual']=$r[nojual];
//$_SESSION['nojual']=$r[nojual];
if ($_SESSION['status']=='dokter') // ini untuk admin
{
header("location:home_dokter.php");
}else if($_SESSION['status']=='apotik'){
header("location:uji.php");
}else if($_SESSION['status']=='bagian persediaan'){
header("location:obat.php");
}else{
print "<script>alert('anda salah login!');
javascript:history.go(-1);</script>";
exit;
}
?>