Guest User

Untitled

a guest
Dec 7th, 2017
392
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.24 KB | None | 0 0
  1. <?php
  2. include "Includes/Functions.php";
  3.  
  4. $online = time();
  5. $from_user = strip_tags($_POST['ref']);
  6. $reg = gmdate('Y-m-d h:i:s');
  7.  
  8. if($_POST['check']) {
  9. $email = $_POST['email'];
  10. $check = mysql_result(mysql_query("SELECT COUNT(*) FRIN `users` WHERE `email` = '$email'"), 0);
  11. if($check == 0) {
  12. echo '<font color="green">Email not in use.</font>';
  13. } else {
  14. echo '<font color="red">Email in use. Please use another.</font>';
  15. }
  16. }
  17.  
  18.  
  19. if ($_POST['register']){
  20. $f_name = $_POST['Firstname'];
  21. $l_name = $_POST['Lastname'];
  22. $email = $_POST['Email'];
  23. $remail = $_POST['Email_repeat'];
  24. $pass = $_POST['password'];
  25. $rpass = $_POST['pass_repeat'];
  26. $gender = $_POST['gender'];
  27. $check = mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `email`='$email'"),0);
  28. $email_check = mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `email`='$email'"),0);
  29.  
  30.  
  31.  
  32. if(isset($f_name, $l_name, $email, $remail, $pass, $rpass, $gender)) {
  33. if($email_check == 0) {
  34. if($pass == $rpass) {
  35. if($email == $remail) {
  36. $gen = ($gender == 1) ? 'Male' : 'Female' ;
  37. $link = (isset($_GET['ref'])) ? $_GET['ref'] : 'Reg' ;
  38. $ip = $_SERVER['REMOTE_ADDR'];
  39. $query = mysql_query("INSERT INTO `users` (`id`, `first_name`, `last_name`, `register_ip`, `password`, `gender`, `email`, `register_date`) VALUES('', '$f_name', '$l_name', '$ip', '$pass', '$gen', '$email', '$reg')");
  40. if($query) {
  41. $userid = mysql_result(mysql_query("SELECT MAX(`id`) FROM `users`"), 0);
  42. $subject = "MiNet Account";
  43. $message = "Hello there ".$f_name.",
  44. Welcome to MiNet - The next big social media intergration service!
  45. \n\n
  46. You can now Login with the following Information:\n
  47. Username: $user \n
  48. Password: $pass \n
  49. At localhost/offline/index.php?l=$user&pw=$pass \n
  50. Thanks, \n
  51. MiNet Staff \n
  52. Danny Glover.
  53. \n\n
  54. This is an automated response, please do not reply!";
  55. if(mail($email, $subject, $message, "From: DoNotReply@MiNet.com")) {
  56. echo 'Account Created. You can now login. <a href="index.php">Login</a>';
  57. } else {
  58. echo 'Email could not be sent. Your account has still been created though. You can now login. <a href="index.php">Login</a>';
  59. }
  60. } else {
  61. echo 'Something went wrong when registering you.';
  62. }
  63. } else {
  64. echo 'The emails do not match.';
  65. }
  66. } else {
  67. echo 'The passwords do not match.';
  68. }
  69. } else {
  70. echo 'That email is already taken.';
  71. }
  72. } else {
  73. echo 'Please fill in all fields.';
  74. }
  75.  
  76. ?>
  77.  
  78. <html>
  79. <head>
  80. <title>MiNet</title>
  81. <meta http-equiv="Page-Exit" content="blendTrans(Duration=2.0)">
  82. <link rel=stylesheet href=/Styles/theme.css type=text/css>
  83. </head>
  84.  
  85. <body>
  86. <br />
  87. <br />
  88. <div align="center">
  89. <img src="/Images/Homepage/Logo-JPEG.jpg">
  90. </div>
  91. <br />
  92. <br />
  93. <div align="center">
  94. <form action="" method="POST">
  95. <div align="center">
  96. <table width="30%" align="center" border="1" bordercolor="#000000" cellpadding="2" cellspacing="0" class="Main" noresize="noresize">
  97.  
  98. <tr>
  99. <td class="TableHeading" colspan="2">
  100. Register
  101. </td>
  102. </tr>
  103.  
  104. <tr>
  105. <td class="TableArea" colspan="2">
  106. All fields are required and must be genuine information. Any false information may result in the game being inaccessible to your desired username.
  107. </td>
  108. </tr>
  109.  
  110.  
  111. <tr>
  112. <td class="TableArea">
  113. <b>First Name:</b>
  114. </td>
  115. <td class="TableArea">
  116. <input type="text" name="Firstname" class="textbox">
  117. <?php if ($_POST['register'] && (!$f_name)){ echo "<b>Field Left Empty</b>"; } ?>
  118. </td>
  119. </tr>
  120.  
  121. <tr>
  122. <td class="TableArea">
  123. <b>Last Name:</b>
  124. </td>
  125. <td class="TableArea">
  126. <input type="text" name="Lastname" class="textbox">
  127. <?php if ($_POST['register'] && (!$l_name)){ echo "<b>Field Left Empty</b>"; } ?>
  128. </td>
  129. </tr>
  130.  
  131. <tr>
  132. <td class="TableArea">
  133. <b>Email Address:</b>
  134. </td>
  135. <td class="TableArea">
  136. <input type="text" name="Email" class="textbox" value="<?php if ($_POST['check']){ echo "$email"; } ?>">
  137. <?php if ($_POST['register'] && (!$email)){ echo "<b>Field Left Empty</b>"; } ?>
  138. </td>
  139. </tr>
  140.  
  141. <tr>
  142. <td class="TableArea">
  143. <b>Repeat Email:</b>
  144. </td>
  145. <td class="TableArea">
  146. <input type="text" name="Email_repeat" class="textbox" value="<?php if ($_POST['check']){ echo "$remail"; } ?>">
  147. <?php if ($_POST['register'] && (!$remail)){ echo "<b>Field Left Empty</b>"; } ?>
  148. </td>
  149. </tr>
  150.  
  151. <tr>
  152. <td class="TableArea">
  153. <b>Password:</b>
  154. </td>
  155. <td class="TableArea">
  156. <input type="password" name="password" class="textbox">
  157. <?php if ($_POST['register'] && (!$pass)){ echo "<b>Field Left Empty</b>"; } ?>
  158. </td>
  159. </tr>
  160.  
  161. <tr>
  162. <td class="TableArea">
  163. <b>Repeat Pass:</b>
  164. </td>
  165. <td class="TableArea">
  166. <input type="password" name="pass_repeat" class="textbox">
  167. <?php if ($_POST['register'] && (!$rpass)){ echo "<b>Field Left Empty</b>"; } ?>
  168. </td>
  169. </tr>
  170.  
  171. <tr>
  172. <td class="TableArea">
  173. <b>Gender:</b>
  174. </td>
  175. <td class="TableArea">
  176. Male <input type="radio" name="gender" class="TableArea" value="1">
  177. Female <input type="radio" name="gender" class="TableArea" value="2">
  178. <?php if ($_POST['register'] && (!$gender)){ echo "<b>Field Left Empty</b>"; } ?>
  179. </td>
  180. </tr>
  181.  
  182. <tr>
  183. <td class="TableArea" colspan="2">
  184. <div align="center">
  185. <input type="submit" name="register" class="button" value="Register">
  186. </div>
  187. </td>
  188. </tr>
  189. <?php if ($_POST['register']){ echo "<tr><td class='tablearea' colspan='2' align='center'>$message</td></tr>"; } ?>
  190. <tr>
  191. <td class="TableHeading" colspan="2">What is MiNet</td>
  192. </tr>
  193.  
  194. <tr>
  195. <td class="WhatIsMiNet" colspan="2">
  196. TBC
  197. </td>
  198. </tr>
  199.  
  200. </table>
  201.  
  202. <br /><div align="center"><a href="index.php">Index</a> - <a href="forget.php">Lost Password</a> - <a href="contact.php">Contact Us</a></div>
  203. <br /><br />
  204.  
  205. <br />
  206. </table>
  207. </div>
  208. </form>
  209.  
  210. </body>
  211. </html>
Add Comment
Please, Sign In to add comment