Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- include_once ('config.php');
- ob_start();
- if(isset($_POST['submit']) && !empty($_POST['username']) && !empty($_POST['password'])) {
- $username = $_POST['username'];
- $password = $_POST['password'];
- $username = mysql_real_escape_string($username);
- $password = md5($password);
- $sql = mysql_query("SELECT * FROM users WHERE username = '$username' AND password = '$password'");
- $nr = mysql_num_rows($sql);
- if($nr == 0) {
- echo '<div class="errormsg">Username or Password is incorrect</div>';
- }else{
- while($row = mysql_fetch_array($sql)) {
- $_SESSION['lia'] = $row['username'];
- }
- header ('Location: me.php');
- }
- }
- ob_flush();
- ?>
- <html>
- <head>
- <link href='/login.css' rel='stylesheet' type='text/css'>
- <title>Welcome ZeloCMS</title>
- </head>
- <body>
- <div class="loginBox">
- <div class="mid">
- <center><a href='register.html'><div class=register_box>Register Today!</div></a></center>
- <center><form action='index.php' method='POST'>
- <b>Username: <input type='text' name='username'><br />
- <b>Password: <input type='password' name='password'><br />
- <input type='submit' name='submit' value='Sign In' " />
- </form></center></div></div>
- </body>
- </html>
Add Comment
Please, Sign In to add comment