Jump to content

[SOLVED] Help with T_DOUBLEARROW in a Dynamically Updated Function


nz_mitch

Recommended Posts

Sorry - the subject is probably totally useless. If a mod can think of a better way of describing it that'll be more helpful to people in the future, please change it!

 

Thanks to the awesome help I got in this thread here, I've got all the information I need ready to load back into a database using the API.

 

The values I've got from the form (which are all loading correctly) are $email_out, $name and $ref.

 

The code I'm using below, which works when the third part (, "ReferringAgent" => "$ref") isn't included is as follow:

 

	$result = $cm->subscriberAddWithCustomFields("$email_out","$name", "ReferringAgent" => "$ref");
		if($result['Result']['Code'] == 0)
	echo 'Success';
else
	echo 'Error : ' . $result['Result']['Message'];

 

With the third part included I get the following PHP error:

Parse error: syntax error, unexpected T_DOUBLE_ARROW in /home/www/domain.com/web/api/index.php on line 141

 

I'm guessing I'm doing something stupid with quotation marks, but I can't figure it out..

 

Thanks so much in advance!

 

EDIT: Doh! Apparently all I needed to do was make:

"ReferringAgent" => "$ref"

"ReferringAgent => $ref"

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.