Help with PHP Cloaking code

Discussion in 'PHP' started by aftermarket, Mar 30, 2007.

  1. #1
    <?
    if( $_SERVER['HTTP_REFERER'] )  
        $parsed = parse_url( $_SERVER['HTTP_REFERER'] );
    
    function is_cloaked( $hostname = null )
    {
        $hosts = array
        (
            "digitalpoint.com",
            "google.com",
            "yahoo.com"
        );
        return @in_array( $hostname, $hosts );  
    }
    ?>
    <html>
    <?
    if( is_cloaked( $parsed['host'] ) ) :
    ?>
    <!-- PAGE FOR CLOAKED VISITORS -->
    <head>
    <title>Page for Cloaked Visitors</title>
    </head>
    <body>
    Page for Cloaked Visitors
    </body>
    <?
    else:
    ?>
    <!-- PAGE FOR UNCLOAKED VISITORS -->
    <head>
    <title>Page for Uncloaked Visitors</title>
    </head>
    <body>
    Page for Uncloaked Visitors
    </body>
    <?
    endif;
    ?>
    </html>
    PHP:
    How can I get this script to work based on a specific url?for example put a link here on dp for this thread pointed to a website, and it shows the cloaked content based on this.


    I also can't seem to get this to work with redirecting for example I put a link on site1 to site2.com which redirects to my cloaking page and it shows the uncloaked version when I click on the link from site1. Can anyone help.....Thank you if you can
     
    aftermarket, Mar 30, 2007 IP