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"

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.