-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpostpubkey.html
47 lines (36 loc) · 1.23 KB
/
postpubkey.html
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
45
46
47
<?
header("Content-Type: text/plain");
session_start();
$uid = $_REQUEST['u'];
$sessionkey = $_REQUEST['s'];
$pubkey = $_REQUEST['k'];
//print_r($_REQUEST);
//$devicephonenumberfield = $_REQUEST['devicephonenumberfield'];
//$hosturlfield = $_REQUEST['hosturlfield'];
$dbname = "cloudify";
$dbhostname="db02.transactionalweb.net";
$dblogin = "cloudify";
$dbpassword="cloudify";
if( !($dbLink = mysql_connect($dbhostname, $dblogin, $dbpassword))) {
print("Failed phase1 to connect to server!\n");
print("Request Aborted!\n");
exit();
}
if( ! mysql_select_db($dbname, $dbLink) ) {
print("Failed phase2 to connect to database on server!<BR>\n");
print("Request Aborted!\n");
exit();
}
$q1 = "UPDATE users set ";
$q1 .= "pubkey='" . $pubkey . "' WHERE ";
$q1 .= " uid='" . $uid . "' AND ";
$q1 .= " sessionkey='" . $sessionkey . "' limit 1; ";
$dbr1 = mysql_query($q1);
$row1 = mysql_fetch_object($dbr1);
//print "<PRE>";
//print $q1;
//print_r($row1);
//print "</PRE>";
print "Updated Public key! " ;
exit();
?>