Example #1
0
if (isset($_REQUEST['url'], $_REQUEST['title'], $_REQUEST['tags'])) {
    exit(_AddLink($_REQUEST['url'], $_REQUEST['title'], $_REQUEST['tags']));
} else {
    if (isset($_REQUEST['url'], $_REQUEST['tags'])) {
        exit(CopyUrlToTags((int) $_REQUEST['url'], $_REQUEST['tags']));
    } else {
        if (isset($_REQUEST['url'], $_REQUEST['title'])) {
            exit(ChangeUrlTitle((int) $_REQUEST['url'], $_REQUEST['title']));
        } else {
            if (isset($_REQUEST['url'])) {
                header('Content-type: application/json; charset="utf-8"');
                exit(GetUrlUsage($_REQUEST['url']));
            } else {
                if (!empty($_GET['code'])) {
                    $code = strtoupper($_GET['code']);
                    $id = Xnary::toInt($code);
                    if ($url = $db->select_one('l_urls', 'url', array('id' => (int) $id))) {
                        header('Location: ' . $url);
                    }
                    exit('#' . $id);
                }
            }
        }
    }
}
// View tags //
$szTags = trim(@$_GET['tags']) ?: trim(@$_GET['t']) ?: '';
ViewUrlsByTag(valid_tags($szTags));
/**
 * Get URL usage from db
 */