| 
									
										
										
										
											2018-10-12 15:37:13 -04:00
										 |  |  | --- | 
					
						
							|  |  |  | title: Checking Required Inputs | 
					
						
							|  |  |  | --- | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-11-17 11:43:56 -05:00
										 |  |  | ## Checking Required Inputs
 | 
					
						
							| 
									
										
										
										
											2018-10-12 15:37:13 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-11-17 11:43:56 -05:00
										 |  |  | PHP has a few functions to check if the required inputs have been met. Those functions are ```isset```, ```empty```, and ```is_numeric```. | 
					
						
							| 
									
										
										
										
											2018-10-12 15:37:13 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-11-17 11:43:56 -05:00
										 |  |  | ### 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'] | 
					
						
							| 
									
										
										
										
											2018-10-12 15:37:13 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-11-17 11:43:56 -05:00
										 |  |  | if(isset($firstName)){ | 
					
						
							|  |  |  |   echo "firstName field is set". "<br>"; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | else{ | 
					
						
							|  |  |  |   echo "The field is not set."."<br>"; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | ``` |