minusten — 2011-12-20T19:58:56-05:00 — #1
i have this simple code
elseif($POST["Email"] == "" || $POST["Email"] =="Enter your Email address")
can anyone help me with getting it to validate whether it has an @ and a .
felgall — 2011-12-20T20:12:21-05:00 — #2
To properly validate that it is a properly formatted email address use:
minusten — 2011-12-20T20:25:50-05:00 — #3
Thanks , worked perfectly
ralphm — 2011-12-20T21:07:17-05:00 — #4
Interesting. How does that stack up in comparison with a more detailed preg_match check?
minusten — 2012-02-21T04:11:00-05:00 — #5
just looking at this again
when i input isnt valid the browser window just goes plain white the url says its the same page instead of redisplaying the form again
rgf207 — 2012-02-21T10:29:07-05:00 — #6
do you have an error_log file in your directory that you can view? That may tell you what's happening
ralphm — 2012-02-21T23:41:38-05:00 — #7
That's because the code says "exit":
The server is told to display the Contact.html page but not any of its content. So you could remove "exit" and that should let the page display again with the form and all. Or you could display a message etc. to inform the user of what went wrong, which is normally what you'd do.