I get this error:
Notice: Undefined index: user in C:\wamp\www\Banner\Login.php on line 40
Line 40:
if($_POST["Login"]){
same if i remove that line to check the rest then noone of the "$_POST" is responding!
Shouldnt this work? what hae i done wrong? please tell me
Code: Select all
<?php session_start() ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--Includes, session starts, create Database connection-->
<?php
require_once('database/OOP.Database.Login.php');
$db = new database()
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Banner - Login</title>
<link href="Style.css" rel="stylesheet" type="text/css">
</head>
<body>
<!-- PHP Section -->
<table width="100%" height="100%" cellspacing="1">
<td height="25px" colspan="3"></td>
<tr>
</tr>
<tr>
<td width="14%" height="100%" valign="top">
<!--Left Empty Side-->
</td>
<td width="71%">
<table width="100%" height="100%" cellspacing="1">
<tr>
<td class="TdColor" colspan="2" height="130px" valign="top">
<!--Top Picture-->
</td>
</tr>
<tr cellspacing='0'>
<td class="TdColor" width="18%" height="513px" valign="top">
<!--Label Picture-->
<!--Menu-->
<?php
$mysql = "SELECT username, password FROM account_info";
$result = $db->dbquery($mysql);
while($array = $db->fetchArray($result)){
if($_POST["Login"]){
if (($_POST['user']== $array['username']) && ($_POST['pass']== $array['pass'])){
echo "What the <span style='color:blue' title='I'm naughty, are you naughty?'>smurf</span>";
//$_SESSION["inloggning"] = true;
//$_SESSION["user_id"] = $array['saved_id'];
//$_SESSION["användare"] = $array['user'];
//header('Refresh: 0; url=home.php?Action=Home');//Skickas till angiven sida.
//exit;//Lämnar loop.
}
}
}
?>
<center><b>Banner - Online</b></center>
<p>
Username:
<input type="text" name="user"/>
Pass:
<input type="password" name="pass"/>
<input name="Login" type="submit" value="Login" />
</p>
</td>
<td class="TdColor" valign="top">
<!--Main-->
</td>
</tr>
</table>
</td>
<td width="15%" valign="top">
<!--Right Empty Side-->
</td>
</tr>
<tr>
</tr>
</table>
</body>
</html>