daily pastebin goal
62%
SHARE
TWEET

Untitled

a guest Jun 8th, 2017 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. // ODBC
  3. $DB = "KN_Online"
  4. $User = "Knight"
  5. $Pass = "Knight"
  6.  
  7.  
  8. // Function
  9. function sanitize($input,$length)
  10. {
  11.         return substr(htmlentities($input, ENT_QUOTES), 0, $length);
  12. }
  13.  
  14. // Login Info
  15. $login = sanitize(@$_POST['userid'],5);
  16.             $pw = sanitize($_POST['pass1'],5);
  17.             $c_pw =sanitize($_POST['pass2'],5);
  18.             $socNo = sanitize($_POST['charsil'],4);
  19.             $socNo2 = sanitize($_POST['charsil1'],4);
  20.             $email = sanitize($_POST['email'],25);
  21.             $email2 = sanitize($_POST['email1'],25);
  22.  
  23. // Buttons, Text.
  24. echo '
  25. <form action="Register.php" method="post">
  26. ID: <input type="text" name="userid" />
  27. Password: <input type="text" name="pass1" />
  28. Confirm Passowrd: <input type="text" name="pass2" />
  29. Security Code: <input type="text" name="charsil" />
  30. Confirm Security Code: <input type="text" name="charsil1" />
  31. Email: <input type="text" name="email" />
  32. Confirm Email: <input type="text" name="email1" />
  33. ';
  34.  
  35. // Error Codes
  36. if ($pw != $c_pw) {
  37. echo 'Password Confirmed';
  38. die();
  39. }
  40.  
  41. if (!empty($login) {
  42. echo 'Fill In Login Field';
  43. die();
  44. }
  45.  
  46. if (!empty($pw) && !empty($c_pw) {
  47. echo 'Fill in Password Field';
  48. die();
  49. }
  50.  
  51. if (!empty($socNo) && !empty($socNo2) {
  52. echo 'Fill In Security Code Field';
  53. die();
  54. }
  55.  
  56. if (!empty($email) && !empty($email2) {
  57. echo 'Fill In Email Field';
  58. die();
  59. }
  60.  
  61. //Registration
  62. $msconnect=odbc_connect($DB,$User,$Pass);
  63. $stmt = odbc_prepare($msconnect, "INSERT INTO TB_USER (strACcountID, strPasswd, strSocNo, Email) VALUES (?,?,?,?)");
  64.     $result = odbc_execute($stmt, array($login,$pw,$socno,$email));
  65.  
  66.   }
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84. </form>
  85. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top