Advertisement
Guest User

Untitled

a guest
Sep 11th, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. <form method="post" action="proc.php">
  2. <table>
  3. <tr>
  4. <td>Username:</td>
  5. <td><input type="text" name="user" id="user"></td>
  6. </tr>
  7. <tr>
  8. <td>password:</td>
  9. <td><input type="text" name="password" id="password"></td>
  10. </tr>
  11. <tr>
  12. <td></td>
  13. <td><input type="submit" value="submit"></td>
  14.  
  15. </tr>
  16.  
  17. </table>
  18. </form>
  19.  
  20. $dbq = "SELECT * FROM accounts;";
  21. $dbqDoIt = mysqli_query($connect2db, $dbq)or die("error".mysqli_error($connect2db));
  22.  
  23. $getNames = mysqli_fetch_array($dbqDoIt);
  24.  
  25.  
  26. //check if user acc. exists inside vSpot database.
  27. if(($name !== $getNames['username']) || ($pass !== $getNames['password'])){
  28. header("Location:index.php"); /* Redirect browser */
  29.  
  30. $nums = array(1,2,3,4,5);
  31.  
  32. for($i=0; $i<6; $i++){
  33. if($nums[0] < 6 ) echo $i . '<br/>';
  34. }
  35.  
  36. while($getNames = mysqli_fetch_array($dbqDoIt)){
  37. //check if user acc. exists inside my database.
  38. if(($name !== $getNames['username']) || ($pass !== $getNames['password'])){
  39. header("Location:index.php"); /* Redirect them to log in */
  40.  
  41. }
  42.  
  43. }
  44.  
  45. $query = "SELECT user_id FROM accounts WHERE username = :username";
  46.  
  47. $dbq = "SELECT * FROM accounts WHERE username = '$name';";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement