Not signed in (Sign In)

Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.


    • CommentAuthorjohn
    • CommentTimeFeb 11th 2007
     
    Hello All,

    I am looking to write code which displays:
    from which keyword search a person landed on my website and highlighting them, if somebody has written it already, it would be really great if u can share Or can you please guide me how to go about it.


    Thanks in Advance,
    • CommentAuthorprogrammer
    • CommentTimeFeb 11th 2007
     
    Try this

    $url="http://www.google.com/search?q=spyware&meta=";
    //$url=$_SERVER['HTTP_REFERER'];
    @extract(@parse_url($url));
    if (preg_match('/((fr|g)oogle|msn|yahoo|alexa)/i', $host) AND preg_match('/q(uery)?=([^&]+)/i', $query, $keywords))
    {    
    $keywords = array_unique(preg_split('/[\s\+]+/', rawurldecode($keywords[2]), -1, PREG_SPLIT_NO_EMPTY));        
    foreach ($keywords as $keyword)    
    {              
    echo "You come from $host with keyword [".$keyword."]";      
    }
    }