forked from amitmaindola/KrishiMitra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
signup.php
37 lines (35 loc) · 1.05 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="./login.css">
</head>
<body>
<h1>You have successfully registered!</h1>
<a class="btn" href="./LoginFarmer.html">GO and Login</a>
<?php
$password1 = $_POST["password"];
$fname = $_POST["fname"];
$lname = $_POST["lname"];
$phone = $_POST["phone"];
$server = "localhost";
$username = "root";
$password = "";
$con = mysqli_connect($server,$username,$password);
if(!$con){
die("connection to this database is failed due to " . mysqli_connect_error());
}
$sql = "INSERT INTO `abc`.`data` ( `fname`,`lname`, `password`, `phone`) VALUES ( '$fname', '$lname', '$password1', '$phone')";
if($con->query($sql)==true){
// echo "Added to database.";
}
else{
echo("ERROR : " . $con->error);
}
$con->close();
?>
</body>
</html>