I'm having problem with my login php files.
I don't know if it is in the passing of values from inputboxes or connection with my database records.
log-in code:
<td align="right" width="130px">
Username:
</td>
<td><input type="text" size="40" id="username" class="inputbox" /></td>
</tr>
<tr>
<td align="right">
Password:
</td>
<td><input type="password" size="40" id="password" class="inputbox" /></td>
Login checking code:
$sql="SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword'";
$result=mysql_query($sql);
$count=mysql_num_rows($result);
if($count==1){
session_register("myusername");
session_register("mypassword");
header("location:login_success.php");
}
else {
echo "Wrong Username or Password";
And the line producing the error is this:
$myusername=isset($_POST['myusername']) ? $_POST["myusername"] : "";
$mypassword=isset($_POST['mypassword']) ? $_POST["mypassword"] : "";
Error:
Fatal Error:Undefined index: myusername
Undefined index: mypassword
The myusername in POST method is same name of my inputboxes on the login page same as mypassword.
Tried isset but still won't get the right output.
And i'm entering the correct records from my DB.