-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate.php
More file actions
34 lines (24 loc) · 783 Bytes
/
create.php
File metadata and controls
34 lines (24 loc) · 783 Bytes
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
<?php
include 'connection.php';
if (isset($_POST['submit'])) {
$first_name = $_POST['fname'];
$last_name = $_POST['lname'];
$email = $_POST['email'];
$password = $_POST['password'];
$password = sha1($_POST['password']);
$gender = $_POST['gender'];
$sql = "INSERT INTO users (fname,lname,email,password,gender) VALUES ('$first_name' , ' $last_name' , ' $email' , '$password' , '$gender')";
$result = $conn->query($sql);
if($result===true){
echo'New record created successfully!';
}
else {
echo 'Error:'.$sql.'<br>'.$conn->error;
}
$conn->close();
}
?>
<html>
<a class="btn btn-info" href="signup.html"><br><br>Back</a>
<a class="btn btn-info" href="read.php"><br><br>View record from database</a>
</html>