Question

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'     => 'test@test.test',
);
$result = $client->add_contact($api_key, $camp_arr);
$site_url = $cid.".pokemon.com";    
header("Location: http://$site_url") ;
}
?>
Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top