-
Notifications
You must be signed in to change notification settings - Fork 0
/
signup.php
115 lines (99 loc) · 3.22 KB
/
signup.php
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<?php
include 'db.php';
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$full_name = $_POST['full_name'];
$email = $_POST['email'];
$password = password_hash($_POST['password'], PASSWORD_DEFAULT);
try {
$sql = "INSERT INTO users (full_name, email, password) VALUES (:full_name, :email, :password)";
$stmt = $conn->prepare($sql);
$stmt->execute([
':full_name' => $full_name,
':email' => $email,
':password' => $password
]);
// إعادة التوجيه إلى صفحة النجاح
header("Location: success.html");
exit(); // إنهاء تنفيذ السكربت بعد التوجيه
} catch (PDOException $e) {
echo "خطأ: " . $e->getMessage();
}
}
?>
<!DOCTYPE html>
<html lang="ar">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>إنشاء حساب جديد</title>
<style>
body {
margin: 0;
padding: 0;
font-family: Arial, sans-serif;
background: linear-gradient(135deg, #55efc4, #81ecec);
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
}
.form-container {
background-color: white;
padding: 40px;
border-radius: 15px;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
width: 350px;
text-align: center;
}
.form-container h2 {
margin-bottom: 20px;
color: #2d3436;
}
.form-container input {
width: 100%;
padding: 12px;
margin: 10px 0;
border: 1px solid #ccc;
border-radius: 8px;
}
.form-container button {
width: 100%;
padding: 12px;
margin-top: 15px;
border: none;
border-radius: 8px;
background-color: #00b894;
color: white;
font-weight: bold;
cursor: pointer;
transition: background-color 0.3s ease;
}
.form-container button:hover {
background-color: #55efc4;
}
.form-container p {
margin-top: 20px;
font-size: 14px;
}
.form-container a {
color: #6c5ce7;
text-decoration: none;
}
.form-container a:hover {
text-decoration: underline;
}
</style>
</head>
<body>
<div class="form-container">
<h2>إنشاء حساب جديد</h2>
<form action="signup.php" method="POST">
<input type="text" name="full_name" placeholder="الاسم الكامل" required>
<input type="email" name="email" placeholder="البريد الإلكتروني" required>
<input type="password" name="password" placeholder="كلمة المرور" required>
<button type="submit">إنشاء حساب</button>
</form>
<p>لديك حساب بالفعل؟ <a href="login.php">تسجيل الدخول</a></p>
</div>
</body>
</html>