X7ROOT File Manager
Current Path:
/home/u126090504/domains/saiadarshainternationalschool.org.in/public_html
home
/
u126090504
/
domains
/
saiadarshainternationalschool.org.in
/
public_html
/
📁
..
📄
.htaccess
(0 B)
📄
Antiraging-Cell.php
(2.73 KB)
📄
SVM-INT (1) (1).zip
(117.51 MB)
📄
about-us.php
(5.86 KB)
📄
academic-calendar.php
(2.73 KB)
📄
achievements.php
(9.56 KB)
📄
achievers.php
(15.19 KB)
📁
admin
📄
admission-process.php
(6.85 KB)
📄
admission.php
(12.93 KB)
📄
admission_submit.php
(3.38 KB)
📄
album.php
(890 B)
📄
assessment-policy.php
(6.8 KB)
📄
cbse-curriculum-summary.php
(5.99 KB)
📄
computer-courses.php
(22.83 KB)
📄
config.php
(1.27 KB)
📄
contact-us.php
(14.63 KB)
📄
contactdb.php
(796 B)
📄
courses.php
(10.44 KB)
📁
css
📄
director's-message.php
(6.54 KB)
📄
downloads.php
(2.9 KB)
📄
error.log
(14.6 KB)
📄
facilities.php
(6.04 KB)
📄
faculty.php
(10.27 KB)
📄
fee-structure.php
(7.97 KB)
📁
fonts
📄
footer.php
(23.95 KB)
📄
franchise.php
(2.09 KB)
📄
gallery.php
(3.05 KB)
📄
google929b505e9f42f894.html
(53 B)
📄
grievance-form.php
(16.52 KB)
📄
header.php
(19.69 KB)
📄
homework.php
(9.64 KB)
📁
images
📄
index.php
(39.38 KB)
📄
infrastructure-details.php
(5.39 KB)
📁
js
📁
lib
📄
managing-committee.php
(3.34 KB)
📄
media-corner.php
(2.48 KB)
📄
non-academic-achievers.php
(14.65 KB)
📄
payment.php
(21.85 KB)
📄
payment_submit.php
(15.1 KB)
📄
payment_verify.php
(2.31 KB)
📄
placement.php
(8.33 KB)
📄
principal's-message.php
(6.65 KB)
📄
public-disclosure.php
(3.38 KB)
📁
qrcodes
📁
revolution
📁
sai
📄
scope.php
(14.14 KB)
📄
search_videos.php
(1.76 KB)
📄
sitemap.xml
(4.69 KB)
📄
subjects-offered.php
(6 KB)
📄
submit-grievance.php
(3.88 KB)
📁
svm
📄
thank-you.php
(1.28 KB)
📄
u126090504_svmint.sql
(40.87 KB)
📁
uploads
📄
videos.php
(6.87 KB)
Editing: admission_submit.php
<?php declare(strict_types=1); // ✅ Start output buffering to prevent "headers already sent" ob_start(); require_once 'config.php'; // ✅ Always start session if (session_status() === PHP_SESSION_NONE) { session_start(); } /* ---- CSRF check (optional if already done) ---- */ if (empty($_POST['csrf']) || empty($_SESSION['csrf']) || !hash_equals($_SESSION['csrf'], $_POST['csrf'])) { http_response_code(400); exit('Invalid request.'); } /* ---- Helpers ---- */ function only_digits($s){ return preg_replace('/\D+/', '', $s ?? ''); } function safe($s){ return trim((string)($s ?? '')); } /* ---- Collect form data ---- */ $student_name = safe($_POST['student_name'] ?? ''); $father_name = safe($_POST['father_name'] ?? ''); $mother_name = safe($_POST['mother_name'] ?? ''); $class = safe($_POST['class'] ?? ''); $sex = safe($_POST['sex'] ?? ''); $caste = safe($_POST['caste'] ?? ''); $blood_group = safe($_POST['blood_group'] ?? ''); $aadhaar = substr(only_digits($_POST['aadhaar'] ?? ''), 0, 12) ?: null; $mobile = substr(only_digits($_POST['mobile'] ?? ''), 0, 10); $dob = safe($_POST['dob'] ?? ''); $school_name = safe($_POST['school_name'] ?? ''); $notes = safe($_POST['notes'] ?? ''); $consent = isset($_POST['consent']) ? 1 : 0; /* ---- Age calc ---- */ $age_years = null; try { $age_years = (new DateTime($dob))->diff(new DateTime('today'))->y . ' years'; } catch (Throwable $e) {} /* ---- Photo (optional) ---- */ $photo_path = null; if (!empty($_FILES['photo']['name']) && $_FILES['photo']['error'] === UPLOAD_ERR_OK) { $okTypes = ['image/jpeg'=>'jpg','image/png'=>'png','image/webp'=>'webp']; $mime = @mime_content_type($_FILES['photo']['tmp_name']); if (isset($okTypes[$mime]) && $_FILES['photo']['size'] <= 2*1024*1024) { $dir = 'uploads/students/' . date('Y/m'); if (!is_dir($dir)) { mkdir($dir, 0775, true); } $slug = strtolower(preg_replace('/[^a-z0-9]+/i','-', $student_name)) ?: 'student'; $fname = $slug . '-' . date('His') . '-' . bin2hex(random_bytes(3)) . '.' . $okTypes[$mime]; $dest = $dir . '/' . $fname; if (move_uploaded_file($_FILES['photo']['tmp_name'], $dest)) { $photo_path = $dest; } } } /* ---- Insert ---- */ $stmt = $conn->prepare(" INSERT INTO admissions (student_name, father_name, mother_name, class, sex, caste, blood_group, aadhaar, mobile, dob, age_years, photo_path, consent, school_name, notes, created_at) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,NOW()) "); $stmt->bind_param( "ssssssssssssiss", $student_name, $father_name, $mother_name, $class, $sex, $caste, $blood_group, $aadhaar, $mobile, $dob, $age_years, $photo_path, $consent, $school_name, $notes ); if (!$stmt->execute()) { // Clean buffer and show error if needed while (ob_get_level()) { ob_end_clean(); } http_response_code(500); exit('DB Error: ' . $stmt->error); } $stmt->close(); /* ---- Flash message (session) + URL fallback ---- */ $_SESSION['success_message'] = "🎉 Admission submitted successfully! Our team will contact you soon."; session_write_close(); // ✅ flush session to disk immediately // ✅ Clean all output buffers before redirect while (ob_get_level()) { ob_end_clean(); } // ✅ Use absolute path + URL flag as fallback header("Location: /admission.php?ok=1"); exit;
Upload File
Create Folder