Need help of HTTP_REFERER script

Links for php scripts

Moderators: macek, egami, gesf

ranjancom2000
New php-forum User
New php-forum User
Posts: 2
Joined: Sun Feb 02, 2014 7:59 pm

Need help of HTTP_REFERER script

Postby ranjancom2000 » Sun Feb 02, 2014 8:05 pm

I need some help on script it working fine 1 1/2 years back I don't know now it is not working may be because of version change PHP. Is it possible to debug the issue.

The script will get the SERP query from Google and decode it will echo on screen.


Code: Select all

<?php
// get random url
if ((!IsSet($action)) || ($action == "rotate")) {
   $parse = parse_url($_SERVER['HTTP_REFERER']);
$se = $parse["host"];
$raw_var = explode("&", $parse["query"] );
foreach ($raw_var as $one_var) {
    $raw = explode("=", $one_var);
    $var[$raw[0]] = urldecode ($raw[1]);
}
$se = explode (".", $se);
switch ($se[1]) {
    case 'yahoo':
        $keywords = $var['p'];
        break;
    case 'aol':
        $keywords = $var['query'];
        break;
    case 'bing':
        $keywords = $var['q'];
        break;
    default:
        $keywords = $var['q'];
}

<php> echo $_SESSION['kw']; </php>

?>



Now i get a error message in error logs like below

unexpected T_STRING, expecting ',' or ';' in /var/www/html/scripts/go.php on line 7, referer: http://www.google.co.in/url?sa=t&rct=

Return to “PHP Scripts”

Who is online

Users browsing this forum: No registered users and 1 guest