"")) { header("Location:"."gen_confirm.php?errmsg=".urlencode('You are already logged in as '.$_SESSION["avomc_username"])); die(); } $config=mysqli_fetch_array(mysqli_query($link, "select * from avomc_config")); if($config["avomc_signup_verification"]=="no") { header("Location:"."addmember.php"); die(); } $errcnt=0; if(count($_POST)<>0) //IF SOME FORM WAS POSTED DO VALIDATION { if(!get_magic_quotes_gpc()) { $email=str_replace("$","\$",addslashes($_REQUEST["email"])); } else { $email=str_replace("$","\$",$_REQUEST["email"]); } if ( !isset( $_REQUEST["email"] ) || (strlen(trim($_REQUEST["email"] )) == 0) ) { $errs[$errcnt]="Email Address must be provided"; $errcnt++; } elseif(preg_match ("/[;<>&]/", $_REQUEST["email"])) { $errs[$errcnt]="Email can not have any special character (e.g. & ; < >)"; $errcnt++; } else { $mem_query=mysqli_query ($link, "select * from avomc_seekers where avomc_email_addr='$email'"); if ($mem=mysqli_fetch_array($mem_query)) { $errs[$errcnt]="Some member has already registered with this email id."; $errcnt++; } } if($errcnt==0) { $config=mysqli_fetch_array(mysqli_query($link, "select * from avomc_config ")); mysqli_query ($link, "delete from avomc_signups where avomc_email='$email'"); $rnum = mt_rand(1,1000000000); $insert_str="Insert into `avomc_signups` ( avomc_email ,avomc_rnum,avomc_onstamp) VALUES ( '$email','$rnum','" . date("YmdHis",time()) . "')"; mysqli_query($link, $insert_str); if(mysqli_affected_rows($link)>0) { //==================send confirmation mail================ $avomc_null_char=$config["avomc_null_char"]; $signup_url=$config["avomc_site_root"]."/addmember.php?rnum=$rnum&email=".$_REQUEST["email"]; $sql = "SELECT * FROM avomc_mails where avomc_id=10" ; $rs_query=mysqli_query($link, $sql); if ( $rs=mysqli_fetch_array($rs_query) ) { $from =$rs["avomc_fromid"]; $to = $_REQUEST["email"]; $subject =$rs["avomc_subject"]; $header="From:" . $from . "\r\n" ."Reply-To:". $from ; $body=str_replace("%email%", $_REQUEST["email"],str_replace("%password%",$avomc_null_char,str_replace("%lname%", $avomc_null_char,str_replace("%fname%", $avomc_null_char,str_replace("%username%", $avomc_null_char, $rs["avomc_mail"]) )))); $body=str_replace("%signup_url%",$signup_url,str_replace("%login_url%",$avomc_null_char,$body)); if(isset($rs["avomc_html_format"])&&($rs["avomc_html_format"]=="yes")) { $header .= "\r\nMIME-Version: 1.0"; $header .= "\r\nContent-type: text/html; charset=iso-8859-1\r\n"; //$body=str_replace("\n","
",$body); } //echo "--from:-$from----to:-$to---sub:-$subject----head:-$header----"; //echo "
$body
"; //die(); if( $rs["avomc_status"]=='yes') mail($to,$subject,$body,$header); } //======================================================== // echo "
Just comment this before packing
".$signup_url."
"; header ("Location:"."gen_confirm.php?errmsg=".urlencode("Please check your email and follow the link provided in your email to complete the registration process, Thank You.")); die(); }// if inserted else { header("Location:"."gen_confirm.php?err=signup&errmsg=".urlencode("Sorry, some error occurred and unable to complete the signup process.")); die(); } }// if no errors }// if form posted function main () { global $errs, $errcnt; $showform=""; if (count($_POST)>0) { if ( $errcnt<>0 ) { ?>
 Your signup request cannot be processed due to following reasons
 
"No") { ?>
 Signup Process
Email ID *
Your older verification code will be disabled once you request for newer verification code.