-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcustomersignup1.php
32 lines (30 loc) · 1.29 KB
/
customersignup1.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
<?php
#sample connection to database with name test
$server = "localhost";
$username = "root";
$password = "";
$dbname = "agriculture"; #can be any name
$conn = new mysqli($server, $username, $password, $dbname);
if($conn->connect_error){
die("Connection failed.".$conn->connect_error);
}else{
if(isset($_REQUEST['submit'])){
if($_REQUEST['username']!=""&&$_REQUEST['emails']!=""&&$_REQUEST['psw']!=""){
$input = $_REQUEST['username'];
$input1 = $_REQUEST['emails'];
$input2 = $_REQUEST['psw'];
echo '<script>alert("Insertion successfull")</script>';
echo("<script>windows: location='customerlogin.html'</script>");
$sql = "INSERT INTO customersignup(username,emails,psw) VALUES('$input','$input1','$input2')";
if($conn->query($sql)===TRUE){
echo "\n\nThe value is taken into table";
}
else{
echo "\n error in executing";
}
}else{
echo "\nThe value is not provided.";
}
}
}
?>