Hi there.
We are using the following code to check whether submitted e-mail addresses are properly formed, not blank etc…
Can you advise whether this is quite accurate and decent as there seems to be many around!
[code=php]
if (!preg_match(‘/[^x00-x20()<>@,;:\”.[]x7f-xff]+(?:.[^x00-x20()<>@,;:\”.[]x7f-xff]+)*@[^x00-x20()<>@,;:\”.[]x7f-xff]+(?:.[^x00-x20()<>@,;:\”.[]x7f-xff]+)+/’, $_POST[‘EMAIL’])) {
$msg .= “<li>Your e-mail address is invalid.</li>n”;
}
Also, how can you check that a submitted field begins with ‘#’, for example if something was submitted without it beginning with # an error is shown, if JUST # was submitted (so it’s theoretically blank) another error is shown?
Many thanks!
Regards,