any suggestions on changing the validation string

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jjjetplan3
Forum Newbie
Posts: 1
Joined: Tue May 05, 2009 2:00 pm

any suggestions on changing the validation string

Post 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>';
                }
Last edited by Benjamin on Tue May 05, 2009 2:33 pm, edited 1 time in total.
Reason: Added [code=php]..[/code] tags.
david64
Forum Commoner
Posts: 53
Joined: Sat May 02, 2009 8:12 am
Location: Wales

Re: any suggestions on changing the validation string

Post by david64 »

What is the validation string?
mdk999
Forum Newbie
Posts: 22
Joined: Fri May 08, 2009 3:21 pm

Re: any suggestions on changing the validation string

Post by mdk999 »

you'd need to post the content of the validate_email() func
Post Reply