form Validation white page not showing errors
Posted
by
Jess McKenzie
on Stack Overflow
See other posts from Stack Overflow
or by Jess McKenzie
Published on 2014-08-23T04:11:21Z
Indexed on
2014/08/23
4:20 UTC
Read the original article
Hit count: 188
In the example below I am wanting to do all of the 'safety' checks on the $_POST
variables but it seems when I click submit I get a white page why? I am wanting it to show the errors etc
Form Process:
/* check if the form is submitted */
if (isset($_POST['submitButton'])) {
$fullName = $_POST['fullname'];
if($_SERVER['REQUEST_METHOD'] == 'POST' && !empty($fullName))
{
if (!ctype_alpha(str_replace(array("'", "-"), "",$fullName))) {
$errorfullName .= '<span class="errorfullName">*First name should be alpha characters only.</span>';
}
if (strlen($fullName) < 3 OR strlen($fullName) > 40) {
$errorfullName .= '<span class="errorfullName">*First name should be within 3-40 characters long.</span>';
}
}
}
© Stack Overflow or respective owner