Even | Leap | Server | Validation | oop1 | oop2 | oop3 | oop4 | oop5 | oop6 | oop7 |

Fill in the form with your details

"; echo "Enter your title:
"; echo ""; //When you display the text fields in the welcome page, you can use $title, $name, $surname, $surname, $address and $age echo "
"; echo "Enter your name:
"; echo ""; echo "
"; echo "Enter your surname:
"; echo ""; echo "
"; echo "Enter your address:
"; echo ""; echo "
"; echo "Enter your age:
"; echo ""; echo "
"; echo "
"; echo ""; echo ""; } //The check_data function checks to see if the user has left any text field blank, and if so, it generates an error. function check_data() { global $errors_array; if($_REQUEST["title"] == "") { $errors_array[] = "Please enter your title"; } if($_REQUEST["name"] == "") { $errors_array[] = "Please enter your name"; } if($_REQUEST["surname"] == "") { $errors_array[] = "Please enter your name"; } if($_REQUEST["address"] == "") { $errors_array[] = "Please enter your address"; } if($_REQUEST["age"] == "") { $errors_array[] = "Please enter your age"; } } //The show_error function displays any error function show_error() { global $errors_array; foreach ($errors_array as $err) { echo $err. "
"; } } //The handle_data function displays the data the user entered. function handle_data() { echo "Here is your title: "; echo $_REQUEST["title"]; echo "
"; echo "Here is your name: "; echo $_REQUEST["name"]; echo "
"; echo "Here is your surname: "; echo $_REQUEST["surname"]; echo "
"; echo "Here is your address: "; echo $_REQUEST["address"]; echo "
"; echo "Here is your age: "; echo $_REQUEST["age"]; } ?>

Code