-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathebrequest.php
More file actions
44 lines (41 loc) · 1.39 KB
/
ebrequest.php
File metadata and controls
44 lines (41 loc) · 1.39 KB
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
<?php
$appid = $_GET["appid"];
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
$bizsession = new bizsession();
$bizsession->setappid($appid);
$before=$_COOKIE["bizsession_".$appid]."";
$str = $bizsession->initialize($before);
$after=$str;
setcookie("bizsession_".$appid, $str, 0);
$bizsession->sethost($_SERVER['SERVER_NAME']);
$bizsession->setport($_SERVER["SERVER_PORT"]);
$bizsession->setquery($_SERVER["QUERY_STRING"]);
if ($_SERVER["SERVER_PORT"]=80)
{
$bizsession->setpath('http://'.$_SERVER['SERVER_NAME'].$_SERVER["REQUEST_URI"]);
}
else if ($_SERVER["SERVER_PORT"]=443)
{
$bizsession->setpath('https://'.$_SERVER['SERVER_NAME'].$_SERVER["REQUEST_URI"]);
}
else
{
$bizsession->setpath('http://'.$_SERVER['SERVER_NAME'].':'.$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"]);
}
$filename = $bizsession->getfilename();
$in = fopen("php://input", "rb");
$out = fopen($filename, 'w');
while (!feof($in)) {
fwrite($out, fread($in, 8192));
}
fclose($in);
fclose($out);
$bizsession->binaryrequest($filename);
header("Content-Type: stream/ebizmis");
header("Content-Length: " . filesize($filename));
$fp = fopen($filename, 'rb');
fpassthru($fp);
fclose($fp);
unlink($filename);
?>