Jump to content

Probably something stupid...


mattichu
Go to solution Solved by jcbones,

Recommended Posts

hello!

 

I have a page which uses some code from dot mailer.co.uk to add a users data into their address book, once that has been done I would like the page to redirect to a thank you page. 

 

Problem is nothing after that code seems to process.

 

for example:

  $addressbookid=****;
  $email = $email;
  $AudienceType="B2B";
  $OptInType="Single";
  $EmailType="Html";
  $FirstName = $firstname;
  $LastName=$lastname;
  $Mobile = $mobile;
  $notes = "This person made a table booking" ;
  
  $keys = array("FIRSTNAME","LASTNAME","MOBILE");
  $var1 = new SoapVar($FirstName,XSD_STRING,"string","http://www.w3.org/2001/XMLSchema"); //Create an instance of SoapVar for each one of the values
  $var2 = new SoapVar($LastName,XSD_STRING,"string","http://www.w3.org/2001/XMLSchema");
  $var3 = new SoapVar($Mobile,XSD_STRING,"string","http://www.w3.org/2001/XMLSchema");
  $values = array($var1,$var2,$var3);
  $Datafields = array ('Keys'=>$keys,'Values'=>$values);
  $contact = array ("Email"=>$email,"AudienceType"=>$AudienceType,"OptInType"=>$OptInType,"EmailType"=>$EmailType,"ID"=>-1,"DataFields"=>$Datafields,"Notes"=>$notes);
  $params = array ("username"=>$username,"password"=>$password,"contact"=>$contact,"addressbookId"=>$addressbookid);
  return $client->AddContactToAddressbook($params);
  


echo "test"; 

the echo at the end doesn't do anything, any ideas why?

Link to comment
Share on other sites

  • Solution

return exits the script or function.  You shouldn't ever need a return inside of a script, but should use it in a function.  

 

 


 

If called from within a function, the return statement immediately ends execution of the current function, and returns its argument as the value of the function call. return will also end the execution of an eval() statement or script file.

If called from the global scope, then execution of the current script file is ended. If the current script file was included or required, then control is passed back to the calling file. Furthermore, if the current script file was included, then the value given to return will be returned as the value of the include call.

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.