forked from streamcoindev/ForkNote-webwallet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRegistration page
36 lines (30 loc) · 1.23 KB
/
Registration page
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
$da = array("method" => "createAddress");
$da_string = json_encode($da);
$kech2 = curl_init('http://localhost:8070/json_rpc');
curl_setopt($kech2, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($kech2, CURLOPT_POSTFIELDS, $da_string);
curl_setopt($kech2, CURLOPT_RETURNTRANSFER, true);
curl_setopt($kech2, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($da_string))
);
$result2 = curl_exec($kech2);
$det1 = json_decode($result2, true);
$address = $det1['result']['address'];
$servername = "localhost";
$username = "user";
$password = "pass";
$dbname = "database";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "update strm_members set address='$address' where username='$newuser'";
if ($conn->query($sql) === TRUE) {
echo "New record created successfully";
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
$conn->close();