D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
probwael
/
public_html
/
Filename :
dosignup.php
back
Copy
<?php session_cache_expire(120); ini_set('session.gc_maxlifetime', 7200); @session_start(); include("conn.php"); function spamcheck($field) { $field=filter_var($field, FILTER_SANITIZE_EMAIL); if(filter_var($field, FILTER_VALIDATE_EMAIL)) { return TRUE; } else { return FALSE; } } $email=$conn->real_escape_string(htmlentities($_POST['email'],ENT_QUOTES)); $pword=$conn->real_escape_string(htmlentities($_POST['pword'],ENT_QUOTES)); $pword2=$conn->real_escape_string(htmlentities($_POST['pword2'],ENT_QUOTES)); $fullname=$conn->real_escape_string(htmlentities($_POST['fullname'],ENT_QUOTES)); $postal=$conn->real_escape_string(htmlentities($_POST['postal'],ENT_QUOTES)); $phone=$conn->real_escape_string(htmlentities($_POST['phone'],ENT_QUOTES)); $mailcheck = spamcheck($_REQUEST['email']); $spam1 = strip_tags($_REQUEST['spam1']); $spam2 = strip_tags($_REQUEST['spam2']); $local_ip=$_SERVER['SERVER_ADDR']; //check exist $result = mysqli_query($conn, "SELECT * FROM _register where email='$email'"); //get data //$row = $result->fetch_assoc(); //$fullname=$row['fullname']; if ($mailcheck==FALSE) { $_SESSION["msg"]= "<br><font color=red>Invalid email address format. try again!</font><br>"; header("location: signup"); } else if($pword!==$pword2) { $_SESSION["msg"]="<font color=red><b>Invalid Operation!<br>Password confirmation did not match.<br><br></b></font>"; header("location: signup"); } else if($spam1!==$spam2) { $_SESSION["msg"]= "<br><font color=red>Invalid anti-spam code supplied... Try again!</font><br>"; header("location: signup"); } else if (mysqli_num_rows($result) == 0) { $_SESSION["em"]=$email; $dtime=date('d-M-Y - h:i a'); $transid=$_SESSION['transid']; //create account mysqli_query($conn, "insert into _register set fullname='$fullname', postal='$postal', phone='$phone', email='$email', pword='$pword', status='online', regdate='$dtime', lastlogin='$dtime'"); mysqli_query($conn, "update _dcart set cname='$fullname', cmail='$email', cphone='$phone', caddress='$postal' where transid='$transid'"); $uri=$_SESSION["loginto"]; if($uri=='') { $_SESSION["msg"]="<font color=green><b>Congratulations, your registration was successful!<br><br></b></font>"; header("location: dashboard"); } else { header("location: {$uri}"); } } else { $_SESSION["msg"]="<font color=red><b>Email address already exist!<br>login below to complete transaction<br><br></b></font>"; header("location: login"); } ?>