Loading...
Kyandu Bright School
Home
Our School
Academics
Pages
Management
Contact
Parent/student Login
Student Registration
Home
Admissions
Registration
Prospect Student Registration
' . htmlspecialchars($_GET['success']) . '
'; } if (isset($_GET['error'])) { echo '
' . htmlspecialchars($_GET['error']) . '
'; } ?>
First Name
Last Name
Email Address
Phone Number
Date of Birth
Gender
Select Gender
Male
Female
Other
Prefer not to say
Address
City
State/Province
Zip/Postal Code
Country
Nationality
Current School/Institution
Grade Applying For
Select Grade
Play Group
Pre-Primary 1
Pre-Primary 2
Grade 1
Grade 2
Grade 3
Grade 4
Grade 5
Grade 6
Grade 7
Grade 8
Grade 9
Preferred Intake
Select Intake
Jan Intake
May Intake
September Intake
Questions or Additional Information
I would like to receive newsletters and updates
Submit Application
Kindly make Interview Exam Booking fee of Ksh 1,000
setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); // Insert into database $stmt = $pdo->prepare("INSERT INTO prospect_students (first_name, last_name, email, phone, dob, gender, address, city, state, zip, country, nationality, current_school, program, intake, questions, newsletter, created_at) VALUES (:firstName, :lastName, :email, :phone, :dob, :gender, :address, :city, :state, :zip, :country, :nationality, :currentSchool, :program, :intake, :questions, :newsletter, NOW())"); $stmt->execute([ ':firstName' => $firstName, ':lastName' => $lastName, ':email' => $email, ':phone' => $phone, ':dob' => $dob, ':gender' => $gender, ':address' => $address, ':city' => $city, ':state' => $state, ':zip' => $zip, ':country' => $country, ':nationality' => $nationality, ':currentSchool' => $currentSchool, ':program' => $program, ':intake' => $intake, ':questions' => $questions, ':newsletter' => $newsletter ]); // Prepare email content $message = "New student registration details:\n\n"; $message .= "Name: $firstName $lastName\n"; $message .= "Email: $email\n"; $message .= "Phone: $phone\n"; $message .= "Date of Birth: $dob\n"; $message .= "Gender: $gender\n\n"; $message .= "Address:\n$address\n$city, $state $zip\n$country\n\n"; $message .= "Nationality: $nationality\n"; $message .= "Current School: $currentSchool\n"; $message .= "Grade Applying For: " . ucwords(str_replace('-', ' ', $program)) . "\n"; $message .= "Preferred Intake: " . ucwords(str_replace('-', ' ', $intake)) . "\n\n"; $message .= "Questions/Additional Information:\n$questions\n\n"; $message .= "Newsletter Subscription: " . ($newsletter ? 'Yes' : 'No') . "\n"; $headers = "From: $from_email" . "\r\n" . "Reply-To: $email" . "\r\n" . "X-Mailer: PHP/" . phpversion(); // Send emails to all recipients $email_sent = true; foreach ($recipient_emails as $recipient) { if (!mail($recipient, $subject, $message, $headers)) { $email_sent = false; } } // Send confirmation to student $confirmation_subject = "Thank you for registering with Kyandu Bright School"; $confirmation_message = "Dear $firstName,\n\n"; $confirmation_message .= "Thank you for your registration. We have received your application for "; $confirmation_message .= ucwords(str_replace('-', ' ', $program)) . " with preferred intake in "; $confirmation_message .= ucwords(str_replace('-', ' ', $intake)) . ".\n\n"; $confirmation_message .= "Our admissions team will review your application and contact you shortly.\n\n"; $confirmation_message .= "Please remember to pay the Interview Exam Booking fee of Ksh 1,000.\n\n"; $confirmation_message .= "If you have any questions, please contact admissions@kyandubright.xyz\n\n"; $confirmation_message .= "Best regards,\nThe Kyandu Bright School Team"; mail($email, $confirmation_subject, $confirmation_message, $headers); // Redirect to avoid form resubmission header('Location: registration.php?success=Thank+you+for+your+registration!+We+will+contact+you+shortly.'); exit(); } catch (Exception $e) { // Handle errors header('Location: registration.php?error=' . urlencode($e->getMessage())); exit(); } } ?>