mirror of
https://github.com/gamaio/UnPS-API.git
synced 2024-12-22 02:02:40 +00:00
initial commit of a test to use the JSON version of the api
There's an error somewhere
This commit is contained in:
parent
199771b12d
commit
c649fa6030
52
testjson.php
Normal file
52
testjson.php
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
echo "JSON TESTING...<br />\n";
|
||||||
|
$apikey = '580658027';
|
||||||
|
|
||||||
|
$link = "http://localhost/phpmyadmin";
|
||||||
|
$linkid = '5432';
|
||||||
|
$username = "dc0de";
|
||||||
|
$password = "password123";
|
||||||
|
$tags = "Testing password json";
|
||||||
|
$comment = "This is a test of JSON";
|
||||||
|
$email = "tehfoxy.c0de@gmail.com";
|
||||||
|
$appname = "JSON TEST";
|
||||||
|
$imgdata = "This is a double array containing multipart/formdata image upload";
|
||||||
|
|
||||||
|
include('dbsettings.php');
|
||||||
|
include('json.api.backend.php');
|
||||||
|
$api = new api();
|
||||||
|
|
||||||
|
$databases = array(
|
||||||
|
'a' => $apidb,
|
||||||
|
's' => $shortdb,
|
||||||
|
'i' => $imgdb,
|
||||||
|
'u' => $udb
|
||||||
|
);
|
||||||
|
|
||||||
|
$data = array(
|
||||||
|
'link' => $link,
|
||||||
|
'linkid' => $linkid,
|
||||||
|
'username' => $username,
|
||||||
|
'password' => $password,
|
||||||
|
'tags' => $tags,
|
||||||
|
'comment' => $comment,
|
||||||
|
'email' => $email,
|
||||||
|
'appname' => $appname,
|
||||||
|
'imgdata' => $imgdata
|
||||||
|
);
|
||||||
|
|
||||||
|
$command = array(
|
||||||
|
'db' => $databases,
|
||||||
|
'key' => $apikey,
|
||||||
|
'data' => $data
|
||||||
|
);
|
||||||
|
|
||||||
|
$json = json_encode($command);
|
||||||
|
|
||||||
|
//echo $api->shorten($json);
|
||||||
|
|
||||||
|
var_dump(json_decode($json, true));
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
Loading…
Reference in New Issue
Block a user