From 42818b227197951723269a926391cd1c97aa9d0f Mon Sep 17 00:00:00 2001 From: Jacob Hoard <36744177+jhoard08@users.noreply.github.com> Date: Sat, 17 Nov 2018 11:43:56 -0500 Subject: [PATCH] Added information/examples about input checking (#21615) * Added information/examples about input checking * removed boilerplate --- .../forms/checking-required-inputs/index.md | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/guide/english/php/forms/checking-required-inputs/index.md b/guide/english/php/forms/checking-required-inputs/index.md index 68033b6f4e..951b7f99c9 100644 --- a/guide/english/php/forms/checking-required-inputs/index.md +++ b/guide/english/php/forms/checking-required-inputs/index.md @@ -1,13 +1,21 @@ --- title: Checking Required Inputs --- + ## Checking Required Inputs -This is a stub. Help our community expand it. +PHP has a few functions to check if the required inputs have been met. Those functions are ```isset```, ```empty```, and ```is_numeric```. -This quick style guide will help ensure your pull request gets accepted. +### Checking form to make sure its set +The ```isset``` checks to see if the field has been set and isn't null. +Example: +```php +$firstName = $_GET['firstName'] - - -#### More Information: - +if(isset($firstName)){ + echo "firstName field is set". "
"; +} +else{ + echo "The field is not set."."
"; +} +```