Advertisement
swimmerbhs

Untitled

Apr 20th, 2014
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.52 KB | None | 0 0
  1. <?php
  2. session_start();
  3. include 'database_connector.php';
  4.  
  5. if(isset($_POST['submit']))
  6. {
  7.     $userName=$_POST['userName'];
  8.     $passWord=$_POST['passWord'];
  9.     $result=mysqli_query($con,"select *from Users where `userName` ='$userName' and `passWord` ='$passWord'");
  10.     if($result)
  11.     {
  12.             //echo "Successfully deleted".$id;
  13.             $count=mysqli_num_rows($result);   
  14.             //echo $count;
  15.     }
  16.     if($count==1)
  17.     {
  18.         $_SESSION['username']=$username;
  19.         $_SESSION['passWord']=$passWord;
  20.         header("location:users.php");
  21.     }
  22.     else
  23.     {  
  24.         header("location:index.php");  
  25.     }
  26. }
  27. ?>
  28. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  29. <html xmlns="http://www.w3.org/1999/xhtml">
  30. <head>
  31. <link href="index.css" rel="stylesheet" type="text/css" />
  32. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  33. <title>Sign in</title>
  34. </head>
  35. <body>
  36. <div id="signin">
  37. [ <a href="signup.php">Sign Up</a> ]
  38. [ <a href="signin.php">Sign In</a> ]
  39. </div>
  40. <div id="clear"></div>
  41. <div class="navbar">
  42. <ul>
  43. <li><a href="concerts.php" target="_self">Concert</a></li>
  44. <li><a href="restaurants.php" target="_self">Restaurant</a></li>
  45. <li><a href="sports.php" target="_self">Sports</a></li>
  46. </ul>
  47. </div>
  48. <form name="signin" method="post" action="signin.php" id="form">
  49.     Member Login <br /><br />
  50. Username<input name="userName" type="text"><Br />
  51. Password</td><input name="passWord" type="password"><br /><br />
  52. <input type="submit" name="submit" value="submit">
  53. </form>
  54. </body>
  55. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement