Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require'../global.php';
- if (isset($_COOKIE['PeopleHubLogged'])) { header("Location: ../Home.php"); }
- if (!isset($_COOKIE['PeopleHubLogged'])) {
- echo "<center><font size='5'><b>Login to PeopleHub</b></font><br><form method='post'>Email: <input type='text' name='email'><br>Password: <input type='password' name='password'><br><input type='submit' name='submit' value='Log In'></form>";
- if ($_POST['submit']) {
- if ($_POST['email']) {
- if ($_POST['password']) {
- $password = md5($_POST['password']);
- $email = $_POST['email'];
- $p = mysql_query("SELECT * FROM Users WHERE Email='$email' AND Password='$password'");
- if (mysql_fetch_array($p) != 0){
- $registered = mysql_query("SELECT * FROM Users WHERE Email='$email'");
- setcookie("PeopleHubLogged", ".$email.");
- $users = mysql_fetch_array($registered);
- echo "<font color='green'>Hello " . $users['FirstName'] . "! <br>You're logged in! Click the picture that looks like a house to begin!</font>";
- } else { echo "<font color='red'>You might need to check those details. They seem to be wrong.</font>"; }
- } else { echo "<font color='red'>You need to enter a password!</font>"; }
- } else { echo "<font color='red'>You need to enter a email!</font>"; }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment