StevenG89

login.php

May 4th, 2014
304
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.06 KB | None | 0 0
  1. <?php
  2. /* Game Engine: CrimeRPG v1.00
  3.  * Engine Creator: NonStopCoding
  4.  * Engine Programmer: NonStopCoding
  5.  * Personal Contact Email: [email protected]
  6.  * Layout Designer: DopeboyGFX AKA (Tyson Cruz)
  7.  * Contact Email: [email protected]
  8.  * Report Bugs / Glitches: [email protected]
  9.  * Contact Sales Team: [email protected]
  10.  * Contact Support: [email protected]
  11.  * CrimeRPG is © nonstopcoding.com 2014
  12. */
  13.  
  14. include(__DIR__.'/connect.php');
  15.  
  16. # This function will clean the $_POST Data. #
  17. function mres($str) {
  18.     return mysql_real_escape_string($str);
  19. }
  20. # Function End #
  21. if(isset($_POST['submit'])) {
  22.     $username = mres(trim($_POST['username']));
  23.     $password = md5(mres($_POST['password']));
  24.     $res = mysql_query("SELECT * FROM `members` WHERE `username` = ".$_POST['username']);
  25.     if(mysql_num_rows($res) == 1) {
  26.         $error = "There is already a user with that username pick another.";
  27.     }
  28.     $row = mysql_fetch_array($res);
  29.     if($row['password'] == $_POST['password']) {
  30.     } else {
  31.         $error = "You're username/password combo was wrong try again.";
  32.     }
  33. }
  34.  
  35. ?>
Advertisement
Add Comment
Please, Sign In to add comment