Board index   FAQ   Search  
Register  Login
Board index PHP PHP Scripts

Need help of HTTP_REFERER script

Links for php scripts

Moderators: macek, egami, gesf

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=
ranjancom2000
New php-forum User
New php-forum User
 
Posts: 1
Joined: Sun Feb 02, 2014 7:59 pm

Return to PHP Scripts

Who is online

Users browsing this forum: No registered users and 3 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron