Example #1
0
<?php

function param_post($a, $b = null)
{
    echo "{$a}, {$b}";
}
function param_get($a, $b = null)
{
    echo "{$a}, {$b}";
}
function param_request($a, $b = null)
{
    echo "{$a}, {$b}";
}
class Param
{
}
param_post(array('post1' => Param::STRING, 'post2' => Param::STRING));
param_get(array('get1' => Param::STRING, 'get2' => Param::STRING));
param_request(array('req1' => Param::STRING, 'req2' => Param::STRING), 'param_');
echo $post_post1;
echo $get_get1;
echo $param_req1;
//ERROR: undefined variable
echo $post_foo;
//ERROR: undefined variable
echo $get_post1;
//ERROR: undefined variable
echo $get_req1;
Example #2
0
include_once $_SERVER['PHP_ROOT'] . '/lib/fbml/wrapper.php';
include_once $_SERVER['PHP_ROOT'] . '/lib/fbml/implementation/css.php';
include_once $_SERVER['PHP_ROOT'] . '/lib/fbml/mock_ajax.php';
/*
 * This proxies requests from fbjs_ajax and returns either a usable
 * FBML string, a JSON object, or a raw string.
 *
 */
// FBOPEN:SETUP - replace with your own user transmitted as you see fit.
// The normal FBJS system relies on cookies sent, but the open source
// makes no assumptions about the availability of cookies.
// Logged in users have a verified (hashed) cookie set, so
// it is useful to verify these cookies' hashes so as to prevent
// requests masquerading as an incorrect user.
$user = 1240077;
param_post(array('appid' => $PARAM_INT, 'query' => $PARAM_RAW, 'type' => $PARAM_INT, 'url' => $PARAM_STRING, 'fb_mockajax_context' => $PARAM_STRING, 'fb_mockajax_context_hash' => $PARAM_STRING));
$app_id = $post_appid;
if (!$app_id) {
    error_log('No app_id specified in fbjs_ajax_proxy');
    exit;
}
if (is_array($post_query)) {
    // PARAM_RAW needs noslashes
    $post_query = $post_query ? noslashes_recursive($post_query) : array();
} else {
    if ($post_query) {
        // PARAM_RAW needs noslashes
        $post_query = parse_querystring(noslashes($post_query));
    } else {
        $post_query = array();
    }