hey guys..i wold like to ask something about my checkLogin.php
i already created a form using index.php, then i want to validate the form using checkLogin.php.
but after i fill up my form, nothing was display..
here aremy codes
<?
session_start();
include("inc/dbconn.inc");
if(isset($_REQUEST['btn_login']))
{
$conn = mysql_connect($hostname, $username, $password);
mysql_select_db($dbname, $conn);
//create short version of variables['name textfield kat login form']
$name = $_POST['userName'];
$password = $_POST['password'];
//retrieve value from login form
$sql = "SELECT * FROM u_user WHERE userName = '($name)' and password = '($password)'";
$result = mysql_query($sql,$conn) or die ("Could not execute sql");
$num_row = mysql_num_rows($result);
if($num_row == 1)
{
session_register("userName");
session_register("password");
while($row = mysql_fetch_assoc($result)) {
#Load different page based on the access level
if ($row['tahap']=="1")
{
header("menu_admin.php");
}
}
} else
{
//validation
?>
<h3 style="background:#DEF7FE; font-family:'Times New Roman', Times, serif;
font-size:15px; border:1px solid #CCC; color:#OOO; border-radius:10px 10px 10px 10px;
text-align:center; margin-top:250px; width:500px; padding:8px;
margin-left:400px">Your Id or password is incorrect <br />Please <a href="indexBaru.php">log In </a> back</h3>
<? }
mysql_close($conn);
}
?>