SHARE
TWEET

Untitled

a guest Apr 26th, 2018 108 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. include("db.php");
  3. error_reporting(E_ALL);
  4. $error = "";
  5. if(isset($_POST['submit'])){
  6.          
  7.          
  8.     //$sent = $_POST['sent'];
  9.     $username = mysql_real_escape_string($_POST['username']);
  10.     $pass = mysql_real_escape_string($_POST['pass']);
  11.     $pass2 = mysql_real_escape_string($_POST['pass2']);
  12.     $email = mysql_real_escape_string($_POST['email']);
  13. if(isset($_COOKIE['reff']))
  14. {
  15. $reff = mysql_real_escape_string($_COOKIE['reff']);
  16. }else{
  17. $reff = "admin";
  18. }
  19.     $user_ip = $_SERVER['REMOTE_ADDR'];
  20.     if($pass == $pass2){
  21.         $pass = md5($pass);
  22.         mysql_query("INSERT INTO users (username, password, email, user_ip, referral) VALUES ('$username', '$pass', '$email','$user_ip','$reff')")or die( mysql_error());
  23.         header("location: login.php");
  24.     }
  25.     else{
  26.     $error = "<center><strong>Passwords Don't Match</strong></center>";
  27.     }
  28. }
  29. else{
  30.     if ($error == ""){
  31.     }
  32.     else{
  33.         echo "<div align='center'>";
  34.         echo "<table class='Error' border='1'>";
  35.         echo "<tr></tr>";
  36.         echo "<td align='left'>Error: <strong>$error</strong></td>";
  37.         echo "<tr></tr>";
  38.         echo "</table>";
  39.         echo "</div>";
  40.     }
  41. }
  42. include("head.php");?>
  43. <div align="center">
  44. <table id="register" boder="1">
  45. <form action="" method="POST">
  46. <?php //<input type="hidden" name="sent" id="sent" value="1">?>
  47.  
  48. <th align="center">Register For Free<th>
  49. <tr></tr>
  50. <td align="right"><label>Username :</label><input type="text" name="username" id="username"></td>
  51. <tr></tr>
  52. <td align="right"><label>Password :</label><input type="password" name="pass" id="pass"></td>
  53. <tr></tr>
  54. <td align="right"><label>Retype Password :</label><input type="password" name="pass2" id="pass2"></td>
  55. <tr></tr>
  56. <td align="right"><label>Email :</label><input type="text" name="email" id="email"></td>
  57. <tr></tr>
  58. <td align="center"><input type="submit" name="submit" value="Register"></td>
  59. <tr></tr>
  60. </form>
  61. </table>
  62. <div>
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