mattichu Posted April 13, 2013 Share Posted April 13, 2013 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? Quote Link to comment https://forums.phpfreaks.com/topic/276906-probably-something-stupid/ Share on other sites More sharing options...
Solution jcbones Posted April 13, 2013 Solution Share Posted April 13, 2013 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. Quote Link to comment https://forums.phpfreaks.com/topic/276906-probably-something-stupid/#findComment-1424567 Share on other sites More sharing options...
mattichu Posted April 13, 2013 Author Share Posted April 13, 2013 Thanks jcbones! Quote Link to comment https://forums.phpfreaks.com/topic/276906-probably-something-stupid/#findComment-1424570 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.