1

The error appeared on the page is the following Strict Standards: Only variables should be passed by reference in /home/user/public_html/ref/testing_12345/index.php on line 12

<?php       
session_start();
$cid = $_SESSION['cid'];
$gid = $_SESSION['gid'];
require_once 'jsonRPCClient.php';
$api_key = '/secret/';
$api_url = 'http://api2./secret/.com';
$client = new jsonRPCClient($api_url);
$campaigns = $client->get_campaigns(
    $api_key,array ('name' => array ( 'EQUALS' => 'thepride' ))
);
$CAMPAIGN_ID = array_pop(array_keys($campaigns));

if(isset($_POST['submit'])) 
{
    $camp_arr = array (
    'campaign'  => $CAMPAIGN_ID,
    'name'      => 'Test',
    'email'     => '[email protected]',
);
$result = $client->add_contact($api_key, $camp_arr);
$site_url = $cid.".pokemon.com";    
header("Location: http://$site_url") ;
}
?>

1 Answer 1

4

You have problem in this line..

$CAMPAIGN_ID = array_pop(array_keys($campaigns));

Break it up..

$CAMPAIGN_ID = array_keys($campaigns);
$CAMPAIGN_ID = array_pop($CAMPAIGN_ID);

Reason :

The array_pop() function expects an array variable (by reference), not a value.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.