-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsignupsave.php
More file actions
34 lines (26 loc) · 900 Bytes
/
signupsave.php
File metadata and controls
34 lines (26 loc) · 900 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
// Connect to the database
include"inc/database.php";
// Retrieve form data
$name = $_POST["uname"];
$email = $_POST["uemail"];
$address = $_POST["uaddress"];
$mobile = $_POST["umobile"];
$aadhar = $_POST["uaddhar"];
$pass = $_POST["upassword"];
$city = $_POST["ucity"];
$image = $_FILES['uimage']['name']; // Handle file uploads
$imagetmp = $_FILES['uimage']['tmp_name'];
$imagefolder="img/".$image;
move_uploaded_file($imagetmp, $imagefolder);
// Insert data into the database
$sql = "INSERT INTO users (name, email, address, mobile, aadhar, pass, city, image)
VALUES ('$name', '$email', '$address', '$mobile', '$aadhar', '$pass', '$city', '$image')";
if ($conn->query($sql) === TRUE) {
echo "<script> alert ('User registered successfully!')</script>";
header('login.php');
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
$conn->close();
?>