-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsignup.php
33 lines (31 loc) · 927 Bytes
/
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
<?php
if($_SERVER["REQUEST_METHOD"]=="POST"){
$LoginId = test_input($_POST["LoginId"]);
$Password = test_input($_POST["password"]);
}
function test_input($data){
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
$conn = mysqli_connect("loginid","password","SecretKey","PublicKeyN","PublicKeyE","myDB");
// $conn = new mysqli($LoginId,$Password,$SecretKey,$PublicKeyN,$PublicKeyE);
if($conn->connect_error){
die("Connection Failed");
}
// $sql = "CREATE DATABASE myDB (
// loginid VARCHAR(30) NOT NULL,
// password VARCHAR(30) NOT NULL
// SecretKey INT(16),
// PublicKeyN INT(16),
// PublicKeyE INT(16)
// )";
$sql = "INSERT INTO myDB (loginid,password,SecretKey,PublicKeyN,PublicKeyN)
Values
('$LoginId','$Password','$SecretKey','$PublicKeyN',$PublicKeyE')";
if($conn->query($sql) === TRUE){
echo "New Record Created";
}
$conn->close();
?>