Advertisement
Guest User

Untitled

a guest
Mar 30th, 2016
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. require 'connection.php';
  2. session_start();
  3.  
  4. /*
  5. * Add code to retrieve Username and Password values from webform on Drupal 7
  6. */
  7.  
  8. $row = mysql_fetch_assoc(mysql_query("SELECT Username,Password FROM user WHERE Username='".$username."' AND Password='".($password)."'"));
  9. if (($row['Username']) && ($row['Password'])) {
  10. // If everything is OK login.
  11.  
  12. // Retaining session for username.
  13. $_SESSION['Username']=$row['Username'];
  14. header("Location:http://localhost/projectname/welcome");
  15. }
  16. else {
  17. echo "Wrong username and/or password <br/>";
  18. echo "Try to log in again";
  19.  
  20. header('Refresh: 3;url=http://localhost/projectname');
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement