Link to home
Start Free TrialLog in
Avatar of Jack Andrews
Jack AndrewsFlag for United States of America

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_check);
                         
             if(mysql_num_rows($rs_email_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_month,$job_day,$job_year));
                    $ip = $_SERVER['REMOTE_ADDR'];
                        $mail_to = "emailaddress1@gmail.com,emailaddress2@somewhere.com";
                        $mail_subject= "User Registration from Web Site ";
ASKER CERTIFIED SOLUTION
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Jack Andrews

ASKER

perfect --- thanks!

See the only difference is this line
if(mysql_num_rows($rs_email_check)<1){