shannown Posted October 22, 2007 Share Posted October 22, 2007 I am new to PHP so if this doesn't make sense please for give... I am using this following code to validate an email that is entered into my header which will collect it in text file and email the client. // Validation if (! ereg('[A-Za-z0-9_-]+\@[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+', $email)) { die("<p align='center'><font face='Arial' size='3' color='#FFFFFF'>Please enter a valid email</font></p>"); } if (strlen($email) == 0 ) { die("<p align=\"center\"><font face=\"Vrinda\" size=\"4\"color=\"#FFFFFF\">email is empty </font></p>"); } I want to know if instead of using the "die("<p align='center'><font face='Arial' size='3' color='#FFFFFF'>Please enter a valid email</font></p>");" to have text pop up - is there code to call up a .php page instead of text? When I use "include" code it will always go to that page even if a correct email is placed. Here is my goal - when someone types in either a bad emial or no email and hits submit they will be taken to a page which looks the same but with a different header.php file (novalidemail.php) When they retype their correct email address it will place it in my .txt file as well in an email to me. I am using the following script: # ----- eMail Collector # ----- Version 2.2 # ----- Created on: 01/25/07 # ----- Designed by: American Financing # ----- http://www.americanfinancing.net Any ideas?? did that make sense??? Sorry, I'm real green to this. Quote Link to comment https://forums.phpfreaks.com/topic/74374-new-to-php-and-need-help-with-validation-email-collector/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.