-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsignupdatabase1.php
More file actions
56 lines (30 loc) · 866 Bytes
/
Copy pathsignupdatabase1.php
File metadata and controls
56 lines (30 loc) · 866 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
34
35
36
37
38
39
40
41
42
43
44
<?php
// Create connection
$conn = mysqli_connect("localhost","root","", "logininfo");
// Check connection
if (!$conn)
{
die("Connection failed: " . mysqli_connect_error());
}
echo "Connected successfully.";
$fnm=$_POST['firstn'];
$lnm=$_POST['lastn'];
$gen=$_POST['gend'];
$mail=$_POST['emailid'];
$cellno=$_POST['phonnum'];
$addres=$_POST['addres'];
$unm=$_POST['userna'];
$pass=$_POST['passw'];
$confpass=$_POST['confirmpass'];
$sql = "INSERT INTO logindata(fname,lname,gender,emailid,phoneno,address,username,password,confirmpassword)
values('$fnm','$lnm','$gen','$mail','$cellno','$addres','$unm','$pass','$confpass')";
if (mysqli_query($conn, $sql))
{
echo "New record created successfully.";
}
else
{
echo "Error: " . $sql . "<br>" . mysqli_error($conn);
}
mysqli_close($conn);
?>