Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- include 'config.php';
- if(isset($_POST['login']))
- {
- $username = trim(addslashes($_POST['username']));
- $password = md5(trim($_POST['password']));
- $query = mysql_query("SELECT * FROM Users WHERE user = '$username' AND Passwd = '$password' LIMIT 1") or die(mysql_error());
- $row = mysql_fetch_array($query);
- // now we check if they are activated
- if(mysql_num_rows($query) > 0)
- {
- if($row['Activated'] > 0)
- {
- $_SESSION['s_logged_n'] = 'true';
- $_SESSION['s_username'] = $username;
- $_SESSION['s_name'] = $row['Name'];
- header("Location: index.php");
- }
- ?>
- the login page<br>
- <p>You must login to view this page. Enter your username and password below and hit submit:</p>
- <form method="post" action="<?= $_SERVER['PHP_SELF'] ?>">
- <p>Username:<br>
- <input name="username" type="text" Cid="username">
- <p>Password:<br>
- <input name="password" type="password" id="password">
- </p>
- <p>
- <input name="login" type="submit" id="login" value="Submit">
- </p>
- </form>
- <p>Inte registrerad? <a href="register.php">Klicka här!</a> för att bli medlem helt gratis!</p>
Add Comment
Please, Sign In to add comment