Jack Andrews
asked on
need php script mod help for email checker
I have a php script that I need to modify quickly but don't know how. This script processes a form on a Wordpress site and sends a copy to two email addresses. It is currently set to query a mysql db to see if the registrant is already registered. If they are, the script will not send an email to the two $mail_to = addresses. I need to change that so it will regardless of duplicate registrations. The script now is
$sql_email_check = "select * from tbl_search_details where str_email ='$email'";
$rs_email_check = mysql_query($sql_email_che ck);
if(mysql_num_rows($rs_emai l_check)>1 ){
header("Location: http://domain.com/folder");
}else{
$sql_insert= "insert into tbl_search_details ( str_first_name , str_last_name, str_email , str_phone , str_movein_date , bit_active ) values ('$first_name', '$last_name', '$email', '$phone', '$move_in_date','1')";
$rs_insert = mysql_query($sql_insert) or die(mysql_error());
$today = date("Y-m-d");
list($job_year,$job_month, $job_day)= split("-", $today);
$month = date(M,mktime(0,0,0,$job_m onth,$job_ day,$job_y ear));
$ip = $_SERVER['REMOTE_ADDR'];
$mail_to = "emailaddress1@gmail.com,e mailaddres s2@somewhe re.com";
$mail_subject= "User Registration from Web Site ";
$sql_email_check = "select * from tbl_search_details where str_email ='$email'";
$rs_email_check = mysql_query($sql_email_che
if(mysql_num_rows($rs_emai
header("Location: http://domain.com/folder");
}else{
$sql_insert= "insert into tbl_search_details ( str_first_name , str_last_name, str_email , str_phone , str_movein_date , bit_active ) values ('$first_name', '$last_name', '$email', '$phone', '$move_in_date','1')";
$rs_insert = mysql_query($sql_insert) or die(mysql_error());
$today = date("Y-m-d");
list($job_year,$job_month,
$month = date(M,mktime(0,0,0,$job_m
$ip = $_SERVER['REMOTE_ADDR'];
$mail_to = "emailaddress1@gmail.com,e
$mail_subject= "User Registration from Web Site ";
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
See the only difference is this line
if(mysql_num_rows($rs_emai