Referring search engine keywords display?

Instrumentalist

Don't mess with my riddim
Aug 11, 2009
1,804
40
48
San Diego, California
Looking for something that can fill in a search box and/or display keywords from a user's search engine query on my 404 page. I use Wordpress if that makes a difference. Here are some tits as promised.

/wrong section, no boobies for you./

Read the rules of engagement #11 first.
 
Last edited by a moderator:


Old GGW tits....fail

What the fuck are you talking about? Major win

PHP:
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|sTerm|Keywords)=([^&]+)/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
    );
}

+

PHP:
echo $se['Query'] ;

should get you taken care of. It'll work for most major search engines
 
Mods, please remove my hack. I just got an email from JohnnyPal about the mothership threatening to sue because I shared this with all of you WF sleazebags ... I hear they have lots of monies & I'm ready to move on with my life.
 
Thanks for that man, but something seems to be acting up. Whenever I put the code on either the page I want to use it on, or on functions.php in my Wordpress theme folder, I get nothing. I mean literally my pages completely disappear. I'm in no way a coder, so I don't have any clue.

Here's a set of Asian bouncers.


AznBouncy.gif