white_label_embed
<?php
/**
* Template Name: WLAS
**/
// Define the params to send to CI
// NOTE: Username value should be dynamically populated from the Affiliate's system.
$params=['username'=>[email protected]', 'affiliate_code'=>'SandBox123', 'api_password'=>'testing', ‘wl_type’=>’advanced-search’];
// Initialize the call
$ch = curl_init();
// Set the options
curl_setopt($ch, CURLOPT_URL,"https://connectedinvestors.com/white-label/get-user-token");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
// Get the response
$response = curl_exec($ch);
// Close the connection when you're done
curl_close($ch);
$response = json_decode($response);
// view the response
//var_dump($response->link); die;
if(isset($response->success) && isset($response->success)== 'true') {
// Get the token for use in the iframe
if(isset($response->link)) {
$link = $response->link;
}
} else {
// FAIL
}
?>
<iframe src="<?php echo $link; ?>" frameborder="0" width="100%" height="750px"></iframe>