"; print_form(); } function process_form() { echo 'Hello ' . $_POST['first_name'] . '!'; } function validate_form() { $errors = array(); function isUKPostcode($postcode) { $postcode = strtoupper(str_replace(chr(32),'',$postcode)); if(ereg("^(GIR0AA)|(TDCU1ZZ)|((([A-PR-UWYZ][0-9][0-9]?)|" ."(([A-PR-UWYZ][A-HK-Y][0-9][0-9]?)|" ."(([A-PR-UWYZ][0-9][A-HJKSTUW])|" ."([A-PR-UWYZ][A-HK-Y][0-9][ABEHMNPRVWXY]))))" ."[0-9][ABD-HJLNP-UW-Z]{2})$", $postcode)) { return $postcode; } else { return FALSE; } } function fileUploadOK($pathToDir) { if ((($_FILES["file"]["type"] == "image/gif") || ($_FILES["file"]["type"] == "image/jpeg")) && ($_FILES["file"]["size"] < 80000)) { return $pathToDir; } else { return FALSE; } } if ($_POST['gender']== "") { $errors['gender'] = "

Please select your gender

\n"; } if (!ereg('^[a-zA-Z]\'-{2,75}$', $_POST['full_name'])) { $errors['full_name'] = "

Please enter your full name

\n"; } if (!ereg('^[0-9a-zA-Z]\'-{2,49}$', $_POST['home_address'])) { $errors['home_address'] = "

Please enter your home address

\n"; } if (!isUKPostcode($_POST['home_pcode'])) { $errors['home_pcode'] = "

Please enter your home postcode

\n"; } if (!ereg('^[0-9a-zA-Z]\'-{2,49}$', $_POST['term_address'])) { $errors['term_address'] = "

Please enter your term address

\n"; } if (!isUKPostcode($_POST['term_pcode'])) { $errors['term_pcode'] = "

Please enter your term postcode

\n"; } if (!ereg('^(\+)[\s]*(.*)$', $_POST['home_phone'])) { $errors['home_phone'] = "

Please enter a valid home telephone number

\n"; } if (!ereg('^\d{5} \d{6}$', $_POST['mob_phone'])) { $errors['mob_phone'] = "

Please enter a valid mobile telephone number

\n"; } if (!ereg('^[a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.([a-zA-Z]{2,4})$', $_POST['email'])) { $errors['email'] = "

Please enter a valid email address

\n"; } if ($_POST['country']= "") { $errors['country'] = "

Please select your nationality

"; } if ($_POST['dobDay']= "") { $errors['dobDay'] = "

Please select the day of your Date of Birth

"; } if ($_POST['dobMonth']= "") { $errors['dobMonth'] = "

Please select the month of your Date of Birth

"; } if (!ereg("[0-9]{4}", $_POST['dobYear'])) { $errors['dobYear'] = "

Please enter the year of your Date of Birth

"; } if (!ereg('^[a-zA-Z]$', $_POST['objective'])) { $errors['objective'] = "

Please state your objective

"; } if (!ereg('^[a-zA-Z]$', $_POST['preference'])) { $errors['preference'] = "

Please state your preference

"; } if (!ereg('^[a-zA-Z]$', $_POST['skills'])) { $errors['skills'] = "

Please state your skills

"; } if (fileUploadOK($_POST['photograph'])) { $errors ['photograph']= "

Please upload a valid photograph: " . $_FILES["file"]["error"] . "

"; } return $errors; } function print_form() { printf(' Erasmus CV Generator

Erasmus CV Generator


Gender:
Full Name:
Course:
Home Address:
 
 
 
Postcode:
Term Address:
 
 
 
Postcode:
Home Phone Number:
Mobile Phone Number:
Email:
Nationality:
Date of Birth: --Year--
Objective:
Placement Preference:
Transferable skills:

Please upload your photograph. The file must be gif/jpeg format and less than 80 KB in size.

Select Picture:
 
', $_SERVER["PHP_SELF"]); } ?>