Whats wrong with my code , i cant access to next page.
Looks like the text field cant be read by login.php
Thanks
- <?php
-
session_start();
-
session_register("username");
-
?>
-
<table width="149" border="0" cellpadding="0" cellspacing="0">
-
<!--DWLayoutDefaultTable-->
-
<tr>
-
<td width="9" height="57"> </td>
-
<td width="140" valign="top"><a href="index.htm">back to main page</a> </td>
-
</tr>
-
</table>
-
<?php
-
if ((!$txtuser) or(!$txtpass)){
-
echo"<br>";
-
echo "User Name:$txtuser";
-
echo "<br>";
-
echo "Wrong Password ";
-
}else
-
{
-
include "koneksi.php";
-
$txtpass=md5($password);
-
$query_login=mysql_query("select * from tbluser where username='$txtuser' and password='$txtpass'",$koneksi) or die (mysql_error());
-
while($row=mysql_fetch_array($query_login))
-
{
-
if($txtpass=="$row[password]" && $txtuser=="$row[username]")
-
{
-
header("location:./login/user.php");
-
}
-
else
-
header("location:./index.php?error=1");
-
}}
-
?>