-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathtest.php.bak
59 lines (49 loc) · 1.65 KB
/
test.php.bak
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
48
49
50
51
52
53
54
55
56
57
58
59
<?php
/* JPEGCam Test Script */
/* Receives JPEG webcam submission and saves to local file. */
/* Make sure your directory has permission to write files as your web server user! */
$userName = '';
if(isset($_REQUEST['un'])){
$userName = addslashes($_REQUEST['un']);
}
$toMeet = '';
if(isset($_REQUEST['mt'])){
$toMeet = addslashes($_REQUEST['mt']);
}
$comingFrom = '';
if(isset($_REQUEST['ra'])){
$comingFrom = addslashes($_REQUEST['ra']);
}
$mobile = '';
if(isset($_REQUEST['mn'])){
$mobile = $_REQUEST['mn'];
}
$email = '';
if(isset($_REQUEST['em'])){
$email = $_REQUEST['em'];
}
$timeInSec = time();
$currtime = date('Y-m-d H:i:s',$timeInSec);
$currGMTime = date('Y-m-d H:i:s',($timeInSec+19800));
$status = 1;
$con = mysql_connect("localhost","test","sundar");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("test", $con);
$sql = "INSERT INTO visitorinfo(firstname,tomeet,comingfrom,mobile,emailid,checkin,status)values('$userName','$toMeet','$comingFrom','$mobile','$email','$currtime','$status')";
// Execute query
mysql_query($sql,$con);
$id = mysql_insert_id();
mysql_close($con);
$result = file_put_contents( $id, file_get_contents('php://input') );
if (!$result) {
print "ERROR: Failed to write data to $filename, check permissions\n";
exit();
}
$url = 'http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['REQUEST_URI']) . '/' . $id;
if($comingFrom != 'Family')
$comingFrom .= "(Escort required)";
print "<root><urlsrc>$url</urlsrc><id>$id</id><fname>$userName</fname><tomeet>$toMeet</tomeet><comingfrom>$comingFrom</comingfrom><mobile>$mobile</mobile><email>$email</email><checkin>$currGMTime</checkin><status>$status</status>";
?>