Page 1 of 1

any suggestions on changing the validation string

Posted: Tue May 05, 2009 2:03 pm
by jjjetplan3
Hello there, Any suggestions on changing the validation string to replace duplicate emails in the database rather than spitting them out. any suggestions would help- Nubie

Code: Select all

 
            if (strlen($_POST['sponsor_email']) <= 50 && validate_email($_POST['student_email']))
                {   
                // Do not allow duplicate emails
                $sponsor_email = $_POST['sponsor_email'];
    
                mysql_connect("$host", "$username", "$password")or die("cannot connect"); 
                mysql_select_db("$db_name")or die("cannot select DB");
            
                $double2 = "SELECT sponsor_email
                            FROM sponsor
                            WHERE sponsor_email = '$sponsor_email'";
                $find2 = mysql_query($double2);
        
                if ($find2 && mysql_num_rows($find2) > 0)
                {echo '<p><h3>Email address already exists in our database.</h3></p>
                <a href="sponsor.htm"><strong>Click Here: Return To Form</strong></a>';
                }

Re: any suggestions on changing the validation string

Posted: Sat May 09, 2009 6:47 pm
by david64
What is the validation string?

Re: any suggestions on changing the validation string

Posted: Sat May 09, 2009 10:13 pm
by mdk999
you'd need to post the content of the validate_email() func