-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprocess.php
More file actions
51 lines (39 loc) · 1.53 KB
/
Copy pathprocess.php
File metadata and controls
51 lines (39 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$name = trim($_POST["name"]);
$email = trim($_POST["email"]);
$id = trim($_POST["id"]);
$academicyear= trim($_POST["academicyear"]);
$batch = trim($_POST["batch"]);
if (empty($name) || empty($email) || empty($id) || empty($academicyear) || empty($batch)) {
die(" جميع الحقول مطلوبة. <br><a href='index.php'>العودة للنموذج</a>");
}
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
die(" البريد الإلكتروني غير صحيح. <br><a href='index.php'>العودة للنموذج</a>");
}
$studentData = $name . "|" . $email . "|" . $id . "|" . $academicyear . "|" . $batch . PHP_EOL;
file_put_contents("students.txt", $studentData, FILE_APPEND);
} else {
header("Location: index.html");
exit();
}
?>
<!DOCTYPE html>
<html lang="ar" dir="rtl">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>تم التسجيل</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="container success-box">
<h1>✅ تم تسجيل الطالب بنجاح</h1>
<p>تم حفظ بيانات الطالب في النظام.</p>
<div class="links">
<a href="index.html">تسجيل طالب جديد</a>
<a href="students.php">عرض الطلاب المسجلين</a>
</div>
</div>
</body>
</html>