I am not sure why I keep getting the error message below(Pleae see the Asterisks )
Notice: Undefined index: myusername
Notice: Undefined index: mypassword
Notice: Use of undefined constant myusername -
Fatal error: Call to undefined function stripslashed()
Here is my code
<form action="Main_login.php" method="post" name="fromLogin">
<table width="300" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<form name="form1" method="post" action="checklogin.php">
<td>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td colspan="3"><strong>Member Login </strong></td>
</tr>
<tr>
<td width="78">Username</td>
<td width="6">:</td>
<td width="294"><input name="myusername" type="text" id="myusername"></td>
</tr>
<tr>
<td>Password</td>
<td>:</td>
<td><input name="mypassword" type="text" id="mypassword"></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td><input type="submit" name="Submit" value="Login"></td>
</tr>
</table>
<?php
//user name and password sent from the form
**$username =$_POST["myusername"];
$password =$_POST['mypassword'];**
// To protect Mysqli Injection
**$myusername = stripslashes(myusername);
$mypassword= stripslashed(mypassword);**
$myusername = mysql_real_excape_string(myusername);
$mypassword = mysql_real_excape_string(password);
$sql = "select * from $stafftbl where username = '$myusername' and
password = '$mypassword'";
$result = mysql_query($sql);
//mysqli_num_row is counting table row
$count= $mysql_num_row($result);
if($count== 1){
// register $myusername and $mypassword and redirect to login success.php
section_register("$myusername");
section_register("$mypassword");
header("location:login_success.php");
}
else {
echo "Wrong Username or Password";
}
?>
</form>
Thank you for your time