## EXP.NO: 08 Form Handling in PHP — Create a Recruitment Website Where a Job Seeker Can Upload His/Her Details ### AIM To create a recruitment website using PHP where a job seeker can submit their personal details and upload their resume. The form will handle user input and the file upload process. ### ALGORITHM 1. Create an HTML form for job seekers to submit their personal details (name, email, phone number, etc.) and upload their resume. 2. The form data will be sent to a PHP script for processing. 3. In PHP, validate the form data and handle the file upload securely. 4. Store the job seeker's information in variables and upload the resume to a designated folder. 5. Display a success message once the form has been successfully submitted. ### PROGRAM This experiment has two files: `index.html` and `submit.php`. 1. HTML — `index.html` ```
Error in uploading the file.
"; exit; } if (!in_array($resume_ext, $allowed_types)) { echo "Only PDF, DOC, and DOCX files are allowed.
"; exit; } if ($resume_size > 5000000) { // Limit to 5MB echo "File size should not exceed 5MB.
"; exit; } // Define target directory $upload_dir = 'uploads/'; if (!file_exists($upload_dir)) { mkdir($upload_dir, 0777, true); } // Generate unique filename to avoid conflicts $resume_new_name = uniqid('', true) . '.' . $resume_ext; $resume_path = $upload_dir . $resume_new_name; // Move the uploaded file to the target directory if (move_uploaded_file($resume_tmp, $resume_path)) { echo "Application submitted successfully!
"; echo "Name: $name
"; echo "Email: $email
"; echo "Phone: $phone
"; echo "Resume uploaded successfully: View Resume
"; } else { echo "Failed to upload resume.
"; } } ?> ``` ### OUTPUT Case 1: Successful submission When the job seeker submits valid details and a valid resume, the page displays a success message with the job seeker's details and a link to view the uploaded resume. Case 2: Invalid submission If any required field is empty, the file type is incorrect, or the file size exceeds 5MB, an appropriate error message is displayed. ### RESULT When the job seeker submits the form: * If all inputs are valid and the file upload succeeds, a success message will be displayed with the job seeker's details and a link to view the uploaded resume. * If there are any issues (empty fields, incorrect file type, or file size), appropriate error messages will be shown.