Tuesday, 19 February 2013

form handling in php





































Notes on mondays class 

the aim of correct form handling in php is that when the submit button is clicked that all the details athat are entered are processed correctly.

Example

Name= value & name=value
?firstname=liz&lastname=bouke & age =$& address + & email = liz.lit.ie

there are two functions in php required: $_GET and $_POST

Part 1 - html

<p><label for="firstname"></abel>
firstname<input type="text"  name="firstname" id="firstname"/>

-this code is used for each text field you will create.

Part 2 - php

see the second image

Part 3 - isset function

if i have the values get the values but if i do not have the 
values wait without an error display for values to be put in.



No comments:

Post a Comment