|
@@ -0,0 +1,32 @@
|
|
1
|
+<?php
|
|
2
|
+
|
|
3
|
+$ch = curl_init();
|
|
4
|
+curl_setopt($ch, CURLOPT_URL,"http://10.11.25.107/auth_basic.php");
|
|
5
|
+curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
|
6
|
+
|
|
7
|
+$headers = apache_request_headers();
|
|
8
|
+
|
|
9
|
+if (!isset($headers['Authorization'])) die('Forbidden');
|
|
10
|
+
|
|
11
|
+$headers = array('Authorization: '.$headers['Authorization']);
|
|
12
|
+
|
|
13
|
+curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
|
|
14
|
+
|
|
15
|
+$server_output = curl_exec ($ch);
|
|
16
|
+$info = curl_getinfo($ch);
|
|
17
|
+curl_close ($ch);
|
|
18
|
+
|
|
19
|
+if ($info['http_code']!=200) die('Forbidden');
|
|
20
|
+
|
|
21
|
+include "api.php";
|
|
22
|
+
|
|
23
|
+header('Access-Control-Allow-Origin: *');
|
|
24
|
+$api = new SQLSRV_CRUD_API(array(
|
|
25
|
+ 'hostname'=>'(local)',
|
|
26
|
+ 'username'=>'',
|
|
27
|
+ 'password'=>'',
|
|
28
|
+ 'database'=>'xxx',
|
|
29
|
+ 'charset'=>'UTF-8'
|
|
30
|
+));
|
|
31
|
+$api->executeCommand();
|
|
32
|
+
|