PHP - Conditional:: if login is agent, do this

0 votes
269 views
added Sep 25, 2019 in PHP by lcjr First Warrant Officer (9,190 points)
<?php
$agent_flag = false;
  if(isset($_COOKIE['userDetail'])) {
    // print_r($_COOKIE['userDetail']->agenturl); 
    $c=json_decode($_COOKIE['userDetail']);
    $agent_flag = isset($c->agenturl)?$c->agenturl:false;
    $is_login = true;
  }
?>

<?php if(!empty($agent_flag)):?>
<a class="dropdown-item-bar-new" href="/proagent" target="_blank">Pro Subscription</a>
<div role="separator" class="dropdown-divider-new"></div>
<?php else:?>
<?php endif; ?> 

 

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...