Jump to content

New to PHP and need help with Validation email collector


shannown

Recommended Posts

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.