-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoutputer.php
More file actions
44 lines (33 loc) · 1.19 KB
/
outputer.php
File metadata and controls
44 lines (33 loc) · 1.19 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
<?php
require_once 'globalVariables.php';
$id = $_GET['id'];
$filename = $localFolder . $id . '.xlf';
$data = file_get_contents($filename);
header ("Content-Type:text/xml");
require_once 'HTTP/Request2.php'; //uses PEAR
$request = new HTTP_Request2($locconnect.'send_output.php');
$request->setMethod(HTTP_Request2::METHOD_POST)
->addPostParameter('id', $id)
->addPostParameter('com', 'WFR')
->addPostParameter('data', $data);
try {
$response = $request->send();
if (200 == $response->getStatus()) {
//echo $response->getBody();
} else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
} catch (HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
$request = new HTTP_Request2($this_url.'statusUpdater.php', HTTP_Request2::METHOD_GET);
$url = $request->getUrl();
$url->setQueryVariable('id', $id); // set job id here
$url->setQueryVariable('msg', 'complete'); // set status id here
$result = $request->send();
if($result->getStatus() != 200) {
print "ERROR: Send failed - ".$result->getStatus().": ".$result->getReasonPhrase();
}
unlink($filename);
?>