-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathprocessForm.php
More file actions
46 lines (40 loc) · 1.55 KB
/
processForm.php
File metadata and controls
46 lines (40 loc) · 1.55 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
<?php
include("conn.php");
$message_alert = '';
if(isset($_POST['register'])) {
$fullName = mysql_real_escape_string($_POST['fullName']);
$email = mysql_real_escape_string($_POST['email']);
$age = mysql_real_escape_string($_POST['age']);
$dob = mysql_real_escape_string($_POST['dob']);
$gender = mysql_real_escape_string($_POST['gender']);
$designation = mysql_real_escape_string($_POST['designation']);
if(!empty($_POST['languages'])) {
$language = "";
foreach($_POST['languages'] as $lang) {
$language .= $lang." ";
}
}
$bio = mysql_real_escape_string($_POST['bio']);
$password = mysql_real_escape_string($_POST['password']);
$confirmPassword =mysql_real_escape_string($_POST['confirmPassword']);
$insert = "INSERT INTO users(fullName,email,age,dob,gender,designation,languages,bio,password) VALUES('$fullName','$email',$age,'$dob','$gender','$designation','$language','$bio','$password')";
if($password == $confirmPassword) {
if (mysqli_query($con, $insert)) {
$message_alert = '
<div class="alert alert-success">
<strong>Success!</strong> User Registered<br>
</div>';
} else {
$message_alert = '
<div class="alert alert-danger">
<strong>Failed!</strong> Not Registered!
</div>';
}
} else {
$message_alert = '
<div class="alert alert-warning">
<strong>Failed!</strong> Password does not match!
</div>';
}
}
?>