hi, I have just finshed making a contact form. in the form the action sends it to a page called send.php. This is my problem:
Code:
if(!preg_match('/^[\w-]+(?:\.[\w-]+)*@(?:[\w-]+\.)+[a-zA-Z]{2,6}$/', $to)) {
echo 'bad email' ;
}
when a user enters an incorrect email, it will display the bad email error on the send.php page. This is not want i want it to do.
i want it do display and error above the contact form on the contact page. Like this:
HERE. Try enter an incorrect email, it will display a message above the contact form. How do i do this.