Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'connection.php';
- session_start();
- /*
- * Add code to retrieve Username and Password values from webform on Drupal 7
- */
- $row = mysql_fetch_assoc(mysql_query("SELECT Username,Password FROM user WHERE Username='".$username."' AND Password='".($password)."'"));
- if (($row['Username']) && ($row['Password'])) {
- // If everything is OK login.
- // Retaining session for username.
- $_SESSION['Username']=$row['Username'];
- header("Location:http://localhost/projectname/welcome");
- }
- else {
- echo "Wrong username and/or password <br/>";
- echo "Try to log in again";
- header('Refresh: 3;url=http://localhost/projectname');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement