Location: PHPKode > projects > MembersGear > membersgear/affilates_redirect.php
<?php
   require_once "config/config.php";
  
   require_once INCLUDE_DIR."/users_class.php";   
   $users=new users_class();
   
   if(isset($_GET['thankyou-page']))
    {
      $get_affi_link=trim($_GET['thankyou-page']);
      
      $query="select * from ".TABLE_PREFIX."product_users_affiliate where id=$get_affi_link and isactive=1 limit 1";
      $result=$users->View($query,false,false);
      $flag=true;
      if($result!=false)
       {
              if(count($result)>0)
               {
                 $afflink=urldecode($result[0]['paygear_campaign_link']) ;
                 Redirect($afflink,true);   
                   
               }
              else
                  $flag=false;
               
                 
        
        }
        else
         $flag=false;
     }
   else
     $flag=false;  

  if($flag==false)
   {
   
      $smarty->assign('msg','The affilate link not found or not active.');
      $LOGINPAGE = $smarty->fetch('user_error.tpl');
      $smarty->assign('USER_CONTENT',     $LOGINPAGE); 
      $smarty->display('user_page_main.tpl');
     
   }    

?>
Return current item: MembersGear