Location: PHPKode > projects > MembersGear > membersgear/checkcapability.php
<?php 
    session_start(); 
    error_reporting(E_ALL);
    ini_set('session.gc_maxlifetime', 1800);  
    set_time_limit(300);
    $currentPath= $_SERVER['SCRIPT_FILENAME'] ;    
    $phydir= str_replace('\\','/', $currentPath); 
    $currentpathRev=strrev($phydir);
    $phydirrev=strchr($currentpathRev,"/");
    $phydirrev= strrev($phydirrev);

    $url = $_SERVER['HTTP_HOST'];

    $page = $_SERVER['PHP_SELF'];

    if($url=="localhost")
       $web_url= "http://".$_SERVER['HTTP_HOST'].$page; 
    else
       $web_url= "http://".$url.$page;      

    $web_url=str_replace("/checkcapability.php","",$web_url);
           
    $chk_for_cookie_js=true;
    require_once $phydirrev."includes/functions.php";


$header = <<<EOF
    <html>
        <head>
        <STYLE type="text/css">
           .notificationDiv
            {
                background:#FFFBCC url( $web_url/images/exclamation.png) no-repeat scroll 10px 8px;
                border: 1px solid #E6DB55;
                color:#666452 !important;
                width:100% !important;
                padding:8px 8px 8px 36px;
                text-align:left;
                margin:5px;
               font-family:Verdana,Arial,Helvetica,sans-serif; 
            }
         </STYLE>
        </head>  
        <body>
EOF;
    
            if(!isset($_GET['checktype'])) $_GET['checktype']='javascript';
            
            if($_GET['checktype'] == 'cookie'){ 
                //check if cookie is enabled, if not, show appropriate error message
                if(!isset($_COOKIE['MemberSiteCookie'])){ 
                    echo $header;
                    echo ShowMessageFor('Cookie',$web_url);   
                    
                }else{
                    header('location:'. (isset($_SESSION['Referrer'])?$_SESSION['Referrer']:$web_url.'/index.php') );
                    die;
                }    
            }
            
            //check if javascript is enabled, if not, show appropriate error message
            if($_GET['checktype'] == 'javascript'){
                echo $header;
                echo ShowMessageFor('Javascript',$web_url);
            }

        ?>
        
    </body>
</html>
Return current item: MembersGear