improved examples

This commit is contained in:
Maurits van der Schee 2015-11-03 00:22:51 +01:00
commit 6eb7271d43
5 changed files with 11 additions and 31 deletions

View file

@ -1,31 +0,0 @@
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"http://10.11.25.107/auth_basic.php");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$headers = apache_request_headers();
if (!isset($headers['Authorization'])) die('Forbidden');
$headers = array('Authorization: '.$headers['Authorization']);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$server_output = curl_exec ($ch);
$info = curl_getinfo($ch);
curl_close ($ch);
if ($info['http_code']!=200) die('Forbidden');
include "api.php";
$api = new SQLSRV_CRUD_API(array(
'hostname'=>'(local)',
'username'=>'',
'password'=>'',
'database'=>'xxx',
'charset'=>'UTF-8'
));
$api->executeCommand();

View file

@ -9,3 +9,14 @@ if (!isset($_SERVER['PHP_AUTH_USER'])) {
} else {
header('HTTP/1.0 403 Forbidden');
}
include "api.php";
$api = new SQLSRV_CRUD_API(array(
'hostname'=>'(local)',
'username'=>'',
'password'=>'',
'database'=>'xxx',
'charset'=>'UTF-8'
));
$api->executeCommand();