Advertisement
Guest User

Untitled

a guest
Jul 18th, 2017
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 2.61 KB | None | 0 0
  1. <?php
  2.  
  3. $name=$_POST[name];
  4. $username=$_POST[username];
  5. $email=$_POST[email];
  6. $email2=$_POST[email2];
  7. $password=$_POST[password];
  8. $password2=$_POST[password2];
  9. $terms=$_POST[accept];
  10. $confirm_code=md5(uniqid(rand()));
  11.  
  12. //see if password is correct
  13. if ($password==$password2)
  14. {
  15.  
  16. }
  17. else
  18. {
  19. header("location:villa/incorrectpassword.html");
  20. break;
  21. }
  22.  
  23. //see if email is correct
  24. if ($email==$email2)
  25. {
  26.  
  27. }
  28. else
  29. {
  30. header("location:villa/incorrectemail.html");
  31. break;
  32. }
  33.  
  34. //see if username is alphanumberic
  35. if (!eregi(("[^A-Za-z0-9.^]"),$username))
  36. {
  37.  
  38. }
  39. else
  40. {
  41. header("location:villa/incorrectusername.html");
  42. break;
  43. }
  44.  
  45. //see if name is alpharic
  46. if (!eregi(("[^A-Z a-z^]"),$name))
  47. {
  48.  
  49. }
  50. else
  51. {
  52. header("location:villa/incorrectname.html");
  53. break;
  54. }
  55.  
  56. if (isset($terms))
  57. {
  58. }
  59. else
  60. {
  61. header("location:villa/terms.html");
  62. break;
  63. }
  64.  
  65. if ($name=="")
  66.    {header("location:villa/empty.html"); break;}
  67. elseif ($username=="")
  68.    {header("location:villa/empty.html"); break;}
  69. elseif ($email=="")
  70.    {header("location:villa/empty.html"); break;}
  71. elseif ($password=="")
  72.    {header("location:villa/empty.html"); break;}
  73.  
  74. include('connect.php');  
  75.  
  76. $query=sprintf("SELECT * FROM users WHERE username ='%s'",
  77. mysql_real_escape_string($username));
  78.  
  79. $result=mysql_query($query);
  80. $num=mysql_num_rows($result);
  81.  
  82. if ($num==0)
  83. {}
  84. else
  85. {header('location:villa/nameinuse.html');}
  86.  
  87. $query=sprintf("SELECT * FROM users WHERE username ='%s'",
  88. mysql_real_escape_string($email));
  89.  
  90. $result=mysql_query($query);
  91. $num=mysql_num_rows($result);
  92.  
  93. if ($num==0)
  94. {}
  95. else
  96. {header('location:villa/emailinuse.html');}
  97.  
  98. mysql_query(sprintf("INSERT INTO `b.ingimarsson`.`temp` (`code`, `username`, `email`, `password`) VALUES ('%s', '%s', '%s', '%s')"),
  99. mysql_real_escape_string($name),
  100. mysql_real_escape_string($username),
  101. mysql_real_escape_string($email),
  102. mysql_real_escape_string($password));
  103.  
  104. ?>
  105.  
  106.  
  107.  
  108. <body bgcolor="#252525">
  109. <font color="white" face="arial" >
  110. <b>
  111.      <h2>Nýskráning</h2>
  112.      <h2>______________________________</h2>
  113. </b>
  114. </font>
  115. </body>
  116. <body bgcolor="#252525">
  117. <font color="white" face="arial" >
  118. <b>
  119.  
  120.  
  121. <?php
  122.  
  123. ?>
  124.  
  125. <body bgcolor="#252525">
  126. <font color="white" face="arial" >
  127. <b>
  128.  
  129. <?php
  130.  
  131. echo "fullt nafn: ".$name."<br/>" ;
  132. echo "notendanafn: ".$username."<br/>" ;
  133. echo "netfang: ".$email."<br/>" ;
  134. echo "lykilorð: ";
  135.  
  136.  
  137. ?>
  138.  
  139. <input type="button" value="sýna lykilorð" onclick="alert('<?php echo ($password); ?>')">
  140. <br/>
  141. <br/>
  142.  
  143. <?php
  144.  
  145. echo $confirm_code;
  146.  
  147. ?>
  148.  
  149. <br/>
  150. <br/>
  151. <input type="button" value="halda áfram" onclick="">
  152.  
  153. </b>
  154. </font>
  155. </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement