Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(!isset($_POST['submit'])) {
- echo "
- <form method='post'>
- <input type='text' maxlength='12' name='username'/><br>
- <input type='password' maxlength='30' name='password'/><br>
- <input type='submit' value='Login' name='submit'>
- </form>
- ";
- } else {
- include ('connect.php');
- $username = $_POST['username'];
- $password = md5("sys64738".$_POST['password']);
- $sql = "SELECT * FROM users WHERE username='$username' and password='$password'";
- $result = mysql_query($sql);
- $count = mysql_num_rows($result);
- if($count = 1) {
- echo "You have sucessfully logged in.";
- setcookie('login',$username,time()+86000);
- } else {
- die("invalid username or password");
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement