I'm creating a basic website for class, On my login html page i have 2 textboxes Username and Password and a Login button. On submit i call the php file. It reads the txt_Username but doesn't read txt_Password. Do you have to read a password textbox differently?
Thanks in advance.
HTML page code;
</div>
<div id="Content">
<form id="loginForm" name="loginForm" method="GET" action="Login.php">
<table width="27%" border="0" align="center">
<tr>
<td width="42%">Username:</td>
<td width="58%"><input type="text" name="txt_Username" id="txt_Username" /></td>
</tr>
<tr>
<td width="42%">Password:</td>
<td width="58%"><input type="password" name="txt_Password" id="txt_Password" /> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="btn_validate" id="btn_validate" value="Login" /></td>
</tr>
<tr>
</table>
<p> </p>
</form>
</div>
PHP code;
<?php
session_start();
$server = "host.com";
$schema = "Seatter";
$uid = "user";
$pwd = "password";
$password =$_GET["txt_Password"];
$username =$_GET["txt_Username"];
mysql_connect($server , $uid , $pwd) or die ("server not found");
mysql_select_db($schema) or die ("Database not found");
$sql = "SELECT *
FROM Login_Details
WHERE User_ID = '$username' AND Password = '$password'";
$record = mysql_query($sql) ;
if(mysql_num_rows($record) == 0){
echo "Login Failure: ";
//echo $username; //Username read from html page
echo $password; //Password not read.
//header("location: Login.html");
}
mysql_close();
?>