-
Notifications
You must be signed in to change notification settings - Fork 0
/
putdata.php
29 lines (25 loc) · 967 Bytes
/
putdata.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
<?
$contents = file_get_contents("rawfile.txt");
print $contents;
$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();
}
$nowtime = time();
$filecontent = base64_encode( file_get_contents($_FILES['userfile']['tmp_name']) );
$q1 = "INSERT into rawdatapolled set ";
$q1 .= " rawcontent='" . base64_encode($contents) . "', ";
$q1 .= " tod='" . $nowtime . "', ";
$q1 .= " keyused='" . $nowtime . "'; ";
$dbr1 = mysql_query($q1);
?>