Changing a value in $_POST : _POST « Form « PHP






Changing a value in $_POST

 
$_POST['name'] = trim($_POST['name']);

if (strlen($_POST['name']) == 0) {
    $errors[] = "Your name is required.";
}
  
  








Related examples in the same category

1.Basic PHP form processing
2.if else to check posted variables
3.Verifying a required element
4.Superglobals vs. Globals
5.Testing a required field
6.Set Cookie Data