HenkDeVries Posted February 26, 2014 Share Posted February 26, 2014 Hi, sorry I am new to php but I am a bit stuck. I am using below code to check a license through a webservice. The result of var_dump is bool(true).How can I save the True and use it to for example show an image or a text? Let's say if it's true show something when false do nothing function checkLicense($key, $url = null) { static $wsdl = 'X'; if ($url == null) { $url = $_SERVER['HTTP_HOST']; } $clientOptions = array( 'compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP, //'trace'=> 1, // when the service b0rks, enable the tracing, for easier debugging ); $client = new SoapClient($wsdl, $clientOptions); $params = array( 'LicenseKey' => $key, 'URL' => $url, ); $checkLicenseResponse = $client->CheckLicense($params); return !empty($checkLicenseResponse->IsValid) && $checkLicenseResponse->IsValid === true; } $licensekey = Mage::getStoreConfig('SDOCP_options/module/enable_serial'); $url = ''; var_dump(checkLicense($licensekey, $url)); Quote Link to comment Share on other sites More sharing options...
Solution WebStyles Posted February 26, 2014 Solution Share Posted February 26, 2014 instead of var_dump, $result = checkLicense($licensekey, $url); will store the value in the variable $result. Quote Link to comment Share on other sites More sharing options...
HenkDeVries Posted February 27, 2014 Author Share Posted February 27, 2014 Thanks a lot that worked Quote Link to comment 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.