Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include "Includes/Functions.php";
- $online = time();
- $from_user = strip_tags($_POST['ref']);
- $reg = gmdate('Y-m-d h:i:s');
- if($_POST['check']) {
- $email = $_POST['email'];
- $check = mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `email` = '$email'"), 0);
- if($check == 0) {
- echo '<font color="green">Email not in use.</font>';
- } else {
- echo '<font color="red">Email in use. Please use another.</font>';
- }
- }
- if ($_POST['register']){
- $f_name = $_POST['Firstname'];
- $l_name = $_POST['Lastname'];
- $email = $_POST['Email'];
- $remail = $_POST['Email_repeat'];
- $pass = $_POST['password'];
- $rpass = $_POST['pass_repeat'];
- $gender = $_POST['gender'];
- $check = mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `email`='$email'"),0);
- $email_check = mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `email`='$email'"),0);
- if(isset($f_name, $l_name, $email, $remail, $pass, $rpass, $gender)) {
- if($email_check == 0) {
- if($pass == $rpass) {
- if($email == $remail) {
- $gen = ($gender == 1) ? 'Male' : 'Female' ;
- $link = (isset($_GET['ref'])) ? $_GET['ref'] : 'Reg' ;
- $ip = $_SERVER['REMOTE_ADDR'];
- $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')");
- if($query) {
- $userid = mysql_result(mysql_query("SELECT MAX(`id`) FROM `users`"), 0);
- $subject = "MiNet Account";
- $message = "Hello there ".$f_name.",
- Welcome to MiNet - The next big social media intergration service!
- \n\n
- You can now Login with the following Information:\n
- Username: $user \n
- Password: $pass \n
- At localhost/offline/index.php?l=$user&pw=$pass \n
- Thanks, \n
- MiNet Staff \n
- Danny Glover.
- \n\n
- This is an automated response, please do not reply!";
- if(mail($email, $subject, $message, "From: DoNotReply@MiNet.com")) {
- echo 'Account Created. You can now login. <a href="index.php">Login</a>';
- } else {
- echo 'Email could not be sent. Your account has still been created though. You can now login. <a href="index.php">Login</a>';
- }
- } else {
- echo 'Something went wrong when registering you.';
- }
- } else {
- echo 'The emails do not match.';
- }
- } else {
- echo 'The passwords do not match.';
- }
- } else {
- echo 'That email is already taken.';
- }
- } else {
- echo 'Please fill in all fields.';
- }
- ?>
- <html>
- <head>
- <title>MiNet</title>
- <meta http-equiv="Page-Exit" content="blendTrans(Duration=2.0)">
- <link rel=stylesheet href=/Styles/theme.css type=text/css>
- </head>
- <body>
- <br />
- <br />
- <div align="center">
- <img src="/Images/Homepage/Logo-JPEG.jpg">
- </div>
- <br />
- <br />
- <div align="center">
- <form action="" method="POST">
- <div align="center">
- <table width="30%" align="center" border="1" bordercolor="#000000" cellpadding="2" cellspacing="0" class="Main" noresize="noresize">
- <tr>
- <td class="TableHeading" colspan="2">
- Register
- </td>
- </tr>
- <tr>
- <td class="TableArea" colspan="2">
- All fields are required and must be genuine information. Any false information may result in the game being inaccessible to your desired username.
- </td>
- </tr>
- <tr>
- <td class="TableArea">
- <b>First Name:</b>
- </td>
- <td class="TableArea">
- <input type="text" name="Firstname" class="textbox">
- <?php if ($_POST['register'] && (!$f_name)){ echo "<b>Field Left Empty</b>"; } ?>
- </td>
- </tr>
- <tr>
- <td class="TableArea">
- <b>Last Name:</b>
- </td>
- <td class="TableArea">
- <input type="text" name="Lastname" class="textbox">
- <?php if ($_POST['register'] && (!$l_name)){ echo "<b>Field Left Empty</b>"; } ?>
- </td>
- </tr>
- <tr>
- <td class="TableArea">
- <b>Email Address:</b>
- </td>
- <td class="TableArea">
- <input type="text" name="Email" class="textbox" value="<?php if ($_POST['check']){ echo "$email"; } ?>">
- <?php if ($_POST['register'] && (!$email)){ echo "<b>Field Left Empty</b>"; } ?>
- </td>
- </tr>
- <tr>
- <td class="TableArea">
- <b>Repeat Email:</b>
- </td>
- <td class="TableArea">
- <input type="text" name="Email_repeat" class="textbox" value="<?php if ($_POST['check']){ echo "$remail"; } ?>">
- <?php if ($_POST['register'] && (!$remail)){ echo "<b>Field Left Empty</b>"; } ?>
- </td>
- </tr>
- <tr>
- <td class="TableArea">
- <b>Password:</b>
- </td>
- <td class="TableArea">
- <input type="password" name="password" class="textbox">
- <?php if ($_POST['register'] && (!$pass)){ echo "<b>Field Left Empty</b>"; } ?>
- </td>
- </tr>
- <tr>
- <td class="TableArea">
- <b>Repeat Pass:</b>
- </td>
- <td class="TableArea">
- <input type="password" name="pass_repeat" class="textbox">
- <?php if ($_POST['register'] && (!$rpass)){ echo "<b>Field Left Empty</b>"; } ?>
- </td>
- </tr>
- <tr>
- <td class="TableArea">
- <b>Gender:</b>
- </td>
- <td class="TableArea">
- Male <input type="radio" name="gender" class="TableArea" value="1">
- Female <input type="radio" name="gender" class="TableArea" value="2">
- <?php if ($_POST['register'] && (!$gender)){ echo "<b>Field Left Empty</b>"; } ?>
- </td>
- </tr>
- <tr>
- <td class="TableArea" colspan="2">
- <div align="center">
- <input type="submit" name="register" class="button" value="Register">
- </div>
- </td>
- </tr>
- <?php if ($_POST['register']){ echo "<tr><td class='tablearea' colspan='2' align='center'>$message</td></tr>"; } ?>
- <tr>
- <td class="TableHeading" colspan="2">What is MiNet</td>
- </tr>
- <tr>
- <td class="WhatIsMiNet" colspan="2">
- TBC
- </td>
- </tr>
- </table>
- <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>
- <br /><br />
- <br />
- </table>
- </div>
- </form>
- </body>
- </html>
Add Comment
Please, Sign In to add comment