<?php
session_start();
include "koneksi.php";
$username = $HTTP_POST_VARS['username'];
$password = $HTTP_POST_VARS['password'];
$query = "SELECT * FROM t_login WHERE username = '$username'";
$sql3=ociparse($conn,$query);
$cek3=ociexecute($sql3);
ocicommit($conn);
// cek kesesuaian password
if ($password == $cek3['password'])
{
//echo "<h1>Login Sukses</h1>";
// menyimpan username dan level ke dalam session
$HTTP_SESSION_VARS['tingkat'] = $cek3['tingkat'];
$HTTP_SESSION_VARS['username'] = $cek3 ['username'];
echo "<h1>Login Sukses<br></h1>";
echo "<META HTTP-EQUIV=Refresh CONTENT='2; URL=index.php'>";
}
else
{
echo "<h1>Login gagal</h1>";
}
?>
<?php
session_start();
include "koneksi.php";
$username = $HTTP_POST_VARS['username'];
$password = $HTTP_POST_VARS['password'];
$query = "SELECT * FROM t_login WHERE username = '$username'";
$sql3=ociparse($conn,$query);
$cek=ociexecute($sql3);
$cek3 = oci_fetch_array($cek); // kamu lupa untuk fetch data
// cek kesesuaian password
if ($password == $cek3['password'])
{
//echo "<h1>Login Sukses</h1>";
// menyimpan username dan level ke dalam session
$HTTP_SESSION_VARS['tingkat'] = $cek3['tingkat'];
$HTTP_SESSION_VARS['username'] = $cek3 ['username'];
echo "<h1>Login Sukses<br></h1>";
echo "<META HTTP-EQUIV=Refresh CONTENT='2; URL=index.php'>";
}
else
{
echo "<h1>Login gagal</h1>";
}
?>
coba yang itu. memang kamu harus pake oracle ya? <?php
session_start();
include "koneksi.php";
$username = $HTTP_POST_VARS['username'];
$password = $HTTP_POST_VARS['password'];
$query = "SELECT * FROM t_login WHERE username = '$username'";
$sql3=ociparse($conn,$query);
$cek3=ociexecute($sql3);
ocifetch($cek3); // kamu lupa untuk fetch data
// cek kesesuaian password
if ($password == oci_result($cek3,'password'))
{
//echo "<h1>Login Sukses</h1>";
// menyimpan username dan level ke dalam session
$HTTP_SESSION_VARS['tingkat'] = $cek3['tingkat'];
$HTTP_SESSION_VARS['username'] = $cek3 ['username'];
echo "<h1>Login Sukses<br></h1>";
echo "<META HTTP-EQUIV=Refresh CONTENT='2; URL=index.php'>";
}
else
{
echo "<h1>Login gagal</h1>";
}
?>