Hi bro,
this is my frame work of the simple login script.
now i want a send the id input to the display.php, without changing this frame work coz i only know this way of making a simple login.
<?php
if (isset($_SESSION['basic_is_logged_in'])) {
unset($_SESSION['basic_is_logged_in']);
}
session_start();
$errorMessage = '';
if (isset($_POST['name']) && isset($_POST['id'])) {
mysql_connect('localhost', 'root', 'jackson');
mysql_select_db('praveen');
$user = mysql_query("SELECT name FROM `users` WHERE `users`.`id` = '$_POST[id]'");
$row = mysql_fetch_array( $user );
$name = $_POST['name'];
$fetch = $row['name'];
if ( $name == $fetch ) {
$_SESSION['basic_is_logged_in'] = true;
header('Location: display.php');
exit;
} else {
$errorMessage = 'Sorry, wrong user id / password';
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
if ($errorMessage != '') {
?>
<p align="center"><strong><font color="#990000"><?php echo $errorMessage; ?></font></strong></p>
<?php
}
?>
<form action="" method="POST" name="frmLogin" id="frmLogin">
<table width="60%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>
<table width="100%" border="0" cellspacing="2" cellpadding="2">
<tr>
<td width="40%" align="right"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif">User Name:</font></td>
<td width="60%"><input name="name" type="text" id="name" maxlength="50" /></td>
</tr>
<tr>
<td width="40%" align="right"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif">Password:</font></td>
<td width="60%"><input name="id" type="password" id="id" maxlength="50" /></td>
</tr>
<tr>
<td width="40%"> </td>
<td width="60%"><input name="btnLogin" type="submit" value="Login" id="btnLogin" /></td>
</tr>
</table></td>
</tr>
</table>
</form>
</body>
</html>