1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

tracking.php

Discussion in 'PHP' started by kyle422, Apr 14, 2005.

  1. #1
    I found this file on my server. Anyone know what it does? :confused:
    \n\n" . "\n" . "\n" . "\n" . "" . $_REQUEST['key'] . "\n" . "" . str_replace ("&", "&", $_REQUEST['q']) . "\n" . "" . ($start - 1) . "\n" . "10\n" . "true\n" . "" . $_REQUEST['country'] . "\n" . "false\n" . "" . $_REQUEST['language'] . "\n" . "\n" . "\n" . "\n" . "\n" . "\n\n"; fwrite ($handle, "POST /search/beta2 HTTP/1.0\n"); fwrite ($handle, "Host: api.google.com\n"); fwrite ($handle, "Content-Type: text/xml; charset=utf-8\n"); fwrite ($handle, "SOAPAction: \"urn:GoogleSearchAction\"\n"); fwrite ($handle, "Content-length: " . strlen($body) . "\n\n"); fwrite ($handle, $body); while (!feof ($handle)) { $string = fgetc ($handle); if ($string == '<') break; } while (!feof($handle)) { $string .= fread($handle, 40960); } fclose($handle); return $string; } } if ($_REQUEST['t']) { $query_order = array(1); } else { $num = 10; if ($_REQUEST['se'] == 'y') $num = 50; for ($i = 1; $i <= $_REQUEST['d']; $i += $num) { $query_order[] = $i; } if ($_REQUEST['l'] > 0 && $_REQUEST['l'] < 1001) { $x = $_REQUEST['l'] - 1; $y = $x - ($x % $num) + 1; $query_order[$y / $num] = 1; $query_order[0] = $y; $slice = array_slice($query_order, 1, max (0, ($y / $num) - 1)); rsort ($slice); foreach ($slice as $array_key => $value) { $query_order[$array_key + 1] = $value; } } } if ($_REQUEST['se'] == 'g') { $error = ''; $fail_count = 0; for ($i = 0; $i < count($query_order); $i++) { $start = $query_order[$i]; $data = get_google ($start); $parser = xml_parser_create('UTF-8'); xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1); xml_parse_into_struct($parser, $data, $vals, $index); xml_parser_free($parser); if ($index['FAULTSTRING'][0]) { $error = $vals[$index['FAULTSTRING'][0]]['value']; } elseif (!isset ($vals[$index['ESTIMATEDTOTALRESULTSCOUNT'][0]]['value'])) { $error = 'Unknown Google server error'; } elseif (isset ($vals[$index['ENDINDEX'][0]]['value']) && $vals[$index['ENDINDEX'][0]]['value'] == 0 && !$_REQUEST['t']) { $error = 'Google gave no results'; } else { if ($_REQUEST['u']) { unset ($results_detail); $position = $start; foreach ($index['URL'] as $array_key => $url_key) { if (substr_count ($vals[$url_key]['value'], $_REQUEST['u'])) $results[] = $position; if ($_REQUEST['s']) { $results_detail[$position]['title'] = $vals[$index['TITLE'][$array_key]]['value']; $results_detail[$position]['url'] = $vals[$index['URL'][$array_key]]['value']; } $position++; } } } $results_total = $vals[$index['ESTIMATEDTOTALRESULTSCOUNT'][0]]['value']; if ($error && $fail_count < 5) { $i--; $fail_count++; } if ($results) break; } } elseif ($_REQUEST['se'] == 'y') { $error = ''; $fail_count = 0; for ($i = 0; $i < count($query_order); $i++) { $start = $query_order[$i]; $data = get_page ('api.search.yahoo.com', '/WebSearchService/V1/webSearch?appid=keywordtracker&query=' . urlencode ($_REQUEST['q']) . '&start=' . $start . '&results=50'); $parser = xml_parser_create('UTF-8'); xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1); xml_parse_into_struct($parser, $data, $vals, $index); xml_parser_free($parser); if ($index['ERROR']) { $error = $vals[$index['MESSAGE'][0]]['value']; } if ($_REQUEST['u']) { unset ($results_detail); $position = $start; foreach ($index['URL'] as $url_key) { if ($vals[$url_key]['level'] == 3) { if (substr_count ($vals[$url_key]['value'], $_REQUEST['u'])) $results[] = $position; if ($_REQUEST['s']) { $results_detail[$position]['title'] = $vals[$url_key - 2]['value']; $results_detail[$position]['summary'] = $vals[$url_key - 1]['value']; $results_detail[$position]['url'] = $vals[$url_key]['value']; } $position++; } } } $results_total = $vals[$index['RESULTSET'][0]]['attributes']['TOTALRESULTSAVAILABLE']; if ($error && $fail_count < 5) { $i--; $fail_count++; } if ($results) { if ($_REQUEST['s']) { $position_key = max(0, min ($results[0] - 3 - $start, count ($results_detail) - 10)); $results_detail = array_slice ($results_detail, $position_key, 10); foreach ($results_detail as $result) { $position_key++; $results_new[$position_key + $start - 1] = $result; } $results_detail = $results_new; } break; } } } elseif ($_REQUEST['se'] == 'm') { $error = ''; $fail_count = 0; for ($i = 0; $i < count($query_order); $i++) { $start = $query_order[$i]; $data = get_page ('search.msn.com', '/results.aspx?q=' . urlencode ($_REQUEST['q']) . '&first=' . $start . '&count=10&format=rss'); $parser = xml_parser_create('UTF-8'); xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1); xml_parse_into_struct($parser, $data, $vals, $index); xml_parser_free($parser); unset ($results_detail); $position = $start; foreach ($index['LINK'] as $url_key) { if ($vals[$url_key]['level'] == 4) { if (substr_count ($vals[$url_key]['value'], $_REQUEST['u'])) $results[] = $position; if ($_REQUEST['s']) { $results_detail[$position]['title'] = $vals[$url_key - 1]['value']; $results_detail[$position]['summary'] = $vals[$url_key + 1]['value']; $results_detail[$position]['url'] = $vals[$url_key]['value']; } $position++; } } if ($results) break; if ($error && $fail_count < 5) { $i--; $fail_count++; } } } if (!$results) $results[] = 9999; $output['results'] = implode ('|', $results); if ($error) $output['error'] = $error; if ($_REQUEST['t']) { $output['total'] = $results_total; echo serialize($output); } elseif ($_REQUEST['s']) { $output['total'] = $results_total; $output['detail'] = $results_detail; echo serialize ($output); } else { echo serialize ($output); } ?>
    PHP:

     
    kyle422, Apr 14, 2005 IP
  2. Such Great Heights

    Such Great Heights Peon

    Messages:
    715
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Such Great Heights, Apr 14, 2005 IP
  3. kyle422

    kyle422 Peon

    Messages:
    290
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Is that file added to the root of my server from using the DP keyword tracker?
     
    kyle422, Apr 14, 2005 IP
  4. Such Great Heights

    Such Great Heights Peon

    Messages:
    715
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Yes and No.

    That file is needed to be able to track the Yahoo! and MSN rankings. (Yahoo! only allows so many queries from a certain IP per day.)
    But the tool itself didn't put it there.
    You have to tell the tool where that file is.

    Someone who has access to the tool and your server put it there.
     
    Such Great Heights, Apr 14, 2005 IP
  5. Epica

    Epica Well-Known Member

    Messages:
    1,007
    Likes Received:
    95
    Best Answers:
    0
    Trophy Points:
    170
    #5
    Isn't this a part of the advanced keyword tracker update...? The PHP file we uploaded - it could be named '???.php' whatever - maybe thats what you called it late one night when you were foruming and just forgot ;) heh
     
    Epica, Apr 14, 2005 IP
  6. kyle422

    kyle422 Peon

    Messages:
    290
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I guess I put it there. I can't find in the instructions or the faqs page anything about it. As long as I know it's nothing nefarious. ;)
    Thanks for the help!
     
    kyle422, Apr 14, 2005 IP
  7. Such Great Heights

    Such Great Heights Peon

    Messages:
    715
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Go to your "Edit Preferences" next to the Logout link.

    Then towards the bottom of the preferences there is the "URL To Advanced Usage Script" text box. This is what points to your tracker.php page. Right under that is the "get the script here" link. It's kinda small, err, ok it IS small. but that's where you get it.

    Just FYI
     
    Such Great Heights, Apr 14, 2005 IP
  8. kyle422

    kyle422 Peon

    Messages:
    290
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Thanks Such Great Heights. I was looking around for it and couldn't find it. sigh of relief. :)
     
    kyle422, Apr 14, 2005 IP