Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include("head.php");
- $username = mysql_real_escape_string($_POST['username']);
- $password = mysql_real_escape_string($_POST['password']);
- if($_POST['sent'] == "1")
- {
- if (!$username && !$password)
- {
- $error = "No Username Or Password";
- }else{
- $query = "SELECT * FROM users WHERE username='$username' AND password='".md5($password)."'";
- $string = mysql_query($query);
- $select = mysql_num_rows($string);
- if ($select == 1)
- {
- setcookie("USER", $username, time()+3600);
- header("location: /members/myaccount.php");
- }else{
- $error = "User Not Found";
- }
- }
- }
- if (!$error)
- {
- }else{
- echo "<div align='center'>";
- echo "<table class='Error'>";
- echo "<tr></tr>";
- echo "<td align='left'>$error</td>";
- echo "<tr></tr>";
- echo "</table>";
- echo "</div>";
- }
- ?>
- <div align="center" id="login">
- <table>
- <form action=" " method="POST">
- <input type="hidden" name="sent" id="sent" value="1">
- <tr></tr>
- <th align="right">Login To Go To Members Area</th>
- <tr></tr>
- <td align="right"><label>Username: </label><input type="text" name="username" id="username"></td>
- <tr></tr>
- <td align="right"><label>Password: </label><input type="password" name="password" id="password"></td>
- <tr></tr>
- <td align="center"><input type="submit" value="Login"></td>
- <tr></tr>
- </table>
- </form>
- </div>
Add Comment
Please, Sign In to add comment