Beispiel #1
0
<?php

require_once 'functions.php';
denies_with_json();
$req = get_param();
list($db_name, $table_name, $check_what, $check_is) = null_exit($req, 'db_name', 'table_name', 'what', 'is');
if ($check_what === 'mapper') {
    list($mapped_id, $data_file, $data_url) = mapper_value_exit($db_name, $table_name, $check_is);
    jsonp_nocache_exit(array('status' => 'ok', 'id' => $mapped_id, 'url' => $data_url));
}
jsonp_nocache_exit(array('status' => 'error', 'error' => 'unknow command.'));
Beispiel #2
0
<?php

require_once '../../admin/functions.php';
$req = get_param();
$db_name = @$req['db_name'];
$table_name = @$req['table_name'];
$db_name || ($db_name = 'default');
$table_name || ($table_name = 'default');
$map_key = @$req['name'];
$direct = @$req['direct'];
list($map_val, $data_file, $data_url) = mapper_value_exit($db_name, $table_name, $map_key);
if ($direct === 'true') {
    jsonp_nocache_exit(object_read($data_file));
}
if ($direct === 'false') {
    jsonp_nocache_exit(array('status' => 'ok', 'ID' => $map_val, 'data_file' => $data_url));
}
header("Location: {$data_url}");