i have created one simple login form to verify only username and password.i have created username as admin and password as admin123 in phpmyadmin database.
now if only both the username and password matches then it should display success message.
but for me after giving username name as admin and password as admin123 it is asking for "whether to save or download the file" instead of displaying the message as "login is successfull".why it is asking that one.whats woron in my code.....
below is my code....
<form name="form1" method="post" action="checklogin.php">
<strong>Member Login </strong>
Username: <input name="myusername" type="text" id="myusername" />
Password: <input name="mypassword" type="password" id="mypassword" />
<input type="submit" name="Submit" value="Login" />
it is checklogin.php
// Connect to server and select databse.
mysql_connect("localhost", "root", "")or die("cannot connect");
mysql_select_db("test")or die("cannot select DB");
// username and password sent from form
// To protect MySQL injection (more detail about MySQL injection)
$myusername = stripslashes($myusername);
$mypassword = stripslashes($mypassword);
$myusername = mysql_real_escape_string($myusername);
$mypassword = mysql_real_escape_string($mypassword);
$sql="SELECT * FROM users WHERE username='$myusername' and password='$mypassword'";
// Mysql_num_row is counting table row
// If result matched $myusername and $mypassword, table row must be 1 row
// Register $myusername, $mypassword and redirect to file "login_success.php"
echo "Wrong Username or Password";
it is login_success.php
tell me what went wrong