Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $client_name = $_POST['username'];
- $client_email = $_POST['email'];
- $client_email_retype = $_POST['email2'];
- $client_password = $_POST['password'];
- $client_password2 = $_POST['password2'];
- $client_realname = $_POST['realname'];
- if ($client_name == "")
- {
- echo "<p>You have not entered your name please enter this when returned.<br /><a href=\"register.php\">Redirect Me</a></p>";
- header('Refresh: 5; url=register.php');
- exit();
- }
- if ($client_email == "")
- {
- echo "<p>You have not entered your email please enter this when returned.<br /><a href=\"register.html\">Redirect Me</a></p>";
- header('Refresh: 5; url=register.php');
- exit();
- }
- if ($client_password == "")
- {
- echo "<p>You have not entered a password please enter this when returned.<br /><a href=\"register.html\">Redirect Me</a></p>";
- header('Refresh: 5; url=register.php');
- exit();
- }
- if(!preg_match('/^[a-zA-Z0-9 ._+\-?,():?!$]{0,1000}$/', $client_name))
- {
- echo "<p>Your name contains illegal characters<br /><a href=\"register.php\">Redirect Me</a></p>";
- header('Refresh: 4; url=register.php');
- exit();
- }
- if(!preg_match('/^[a-zA-Z0-9 -._@+\?,():?!$]{0,1000}$/', $client_email))
- {
- echo "<p>Your email contains illegal characters . - _ and @ only.<br /><a href=\"register.php\">Redirect Me</a></p>";
- header('Refresh: 4; url=register.php');
- exit();
- }
- if(!preg_match('/^[a-zA-Z0-9 ._+\-?,():?!$]{0,1000}$/', $client_password))
- {
- echo "<p>Your password contains illegal characters<br /><a href=\"register.html\">Redirect Me</a></p>";
- header('Refresh: 4; url=register.php');
- exit();
- }
- if ($client_email != $client_email_retype)
- {
- echo "<p>Your emails do not match. please after being redirected correct this problem.<br /><a href=\"register.html\">Redirect Me</a></p>";
- header('Refresh: 5; url=register.php');
- exit();
- }
- if ($client_password != $client_password2)
- {
- echo "<p>Your passwords do not match. please after being redirected correct this problem.<br /><a href=\"register.html\">Redirect Me</a></p>";
- header('Refresh: 5; url=register.php');
- exit();
- }
- else
- {
- $client_password = md5('salt',$client_password);
- }
- $host = "removed";
- $username = "removed";
- $password = "removed";
- $db_name = "ACCOUNT_DBF";
- $tbl_name = "ACCOUNT_TBL";
- mysql_connect($host, $username, $password)or die("<p>Could Not connect.</p>");
- mysql_select_db($db_name)or die("<p>Could not find or conenct to the data base.</p>");
- $sql1 = "SELECT realname FROM $tbl_name WHERE realname='$client_realname'";
- $result=mysqul_query($sql1);
- $count=mysql_num_rows($result);
- if($count==1)
- {
- echo "<p>That account name is already registered.</p>";
- exit();
- }
- $sql2 = "INSERT INTO $tbl_name (username, email, password, realname)
- VALUES ('$client_name', '$client_email', '$client_password', '$client_realname')";
- mysql_query($sql2);
- if ($sql2 == true)
- {
- echo "<p>Thank you for registering. I will get back to you as soon as I can to discuss your request.<br /><a href=/forums>Redirect Me</a></p>";
- header('Refresh: 3; url=login.php');
- }
- else
- {
- echo "<p>There seems to be a problem submitting your registration details. Please try again. If it still fails contact me at pulse@zephyrr.com br /><a href=\"register.html\">Redirect Me</a></p>";
- header('Refresh: 3; url=register.php');
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement