Google dan hangi Arama Kriteri İle Gelindiğini PHP ile Öğrenmek, What is the Search Engine Refering Query?

<?

// ----------------------------------------------------------------------------

/* $ref is optional, if not set will use current! */

function seReferer($ref = false){

    $SeReferer = (is_string($ref) ? $ref : $_SERVER['HTTP_REFERER']);

    if( //Check against Google, Yahoo, MSN, Ask and others

        preg_match(

        "/[&\?](q|p|w|searchfor|as_q|as_epq|s|query)=([^&]+)/i",

        $SeReferer,$pcs)

    ){

        if(preg_match("/https?:\/\/([^\/]+)\//i",$SeReferer,$SeDomain)){

            $SeDomain    = trim(strtolower($SeDomain[1]));

            $SeQuery    = $pcs[2];

            if(preg_match("/[&\?](start|b|first|stq)=([0-9]*)/i",$SeReferer,$pcs)){

                $SePos    = (int)trim($pcs[2]);

            }

        }

    }

    if(!isset($SeQuery)){

        if( //Check against DogPile

            preg_match(

            "/\/search\/web\/([^\/]+)\//i",

            $SeReferer,$pcs)

        ){

            if(preg_match("/https?:\/\/([^\/]+)\//i",$SeReferer,$SeDomain)){

                $SeDomain    = trim(strtolower($SeDomain[1]));

                $SeQuery    = $pcs[1];

            }

        }

    }

    // We Do Not have a query

    if(!isset($SeQuery)){ return false; }

    $OldQ=$SeQuery;

    $SeQuery=urldecode($SeQuery);

    // The Multiple URLDecode Trick to fix DogPile %XXXX Encodes

    while($SeQuery != $OldQ){

        $OldQ=$SeQuery; $SeQuery=urldecode($SeQuery);

    }

    //-- We have a query

    return array(

        "Se"=>$SeDomain,

        "Query"=>$SeQuery,

        "Pos"=>(int)$SePos,

        "Referer"=>$SeReferer

    );

}

// ----------------------------------------------------------------------------

?>






Google dan hangi Arama Kriteri İle Gelindiğini PHP ile Öğrenmek, What is the Search Engine Refering Query?

KAYNAK : http://www.tellinya.com/read/2007/07/11/34.html

Bu blogdaki popüler yayınlar

Knight Online Genel Bilgiler ve Tüyolar

Rebirth item upgrade yöntemi knight online

NECLA ROLÜNÜ ÖNCE KABUL ETMEMİŞ