Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- mysql_connect("localhost","root","")
- or DIE('Connection to host is failed, perhaps the service is down!');
- mysql_select_db("online_manager") or DIE('Database name is not available!');
- if(isset ($_POST["username"]) )
- {
- $user = $_POST["username"];
- }
- if(isset ( $_POST["userpass"] ) )
- {
- $pass = $_POST["userpass"];
- }
- //echo "$pass";
- //you used == instead of = in your query
- $usertest = mysql_query("select * from user_information where username = '$user' && password = '$pass' ");
- $user= mysql_num_rows($usertest);
- //echo "$user";
- if($user>0)
- {
- //echo "$usertest";
- //$query = mysql_query("select * from user_information where username = '$user' and password ='$pass'");
- echo "$query";
- while($row = mysql_fetch_array($usertest))
- {
- echo $row['name'];
- echo $row['email'];
- echo $row['address'];
- }
- }
- else {
- echo "Invalid Username or Password<br>Try again with correct one!";
- include_once("index.html");
- }
- ?>
Add Comment
Please, Sign In to add comment