Greenguy's Board


Go Back   Greenguy's Board > Programming & Scripting
Register FAQ Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 2004-03-25, 11:56 AM   #1
Opti
I Didn't Do It
 
Opti's Avatar
 
Join Date: Aug 2003
Location: au
Posts: 795
Send a message via ICQ to Opti
Anyone Using Botspotter Script?

Is anyone using the Botspotter script?

it looks awesome but the PHP code they provide generates an error for me...

Parse error: parse error, unexpected T_VARIABLE in botspotter.php on line 3


... and some of the PHP syntax they use appears quite foriegn to me (as a novice at php coding)

Can anyone see an obvious error around line 3 in this lot?


PHP Code:
<?php// Script Date: 09 Jan 2004
// your botspotter login name
$bsName 'usercode';

// change nothing below this line
function getURI()  {
     global 
$HTTP_SERVER_VARS;
    
$url '/';
    if ( !empty(
$HTTP_SERVER_VARS['PHP_SELF'])) 
      
$url $HTTP_SERVER_VARS['PHP_SELF'];
    elseif ( isset ( 
$HTTP_SERVER_VARS['SCRIPT_URI']) && !empty($HTTP_SERVER_VARS['SCRIPT_URI'])) 
        
$url $HTTP_SERVER_VARS['SCRIPT_URI'];
    if ( isset( 
$HTTP_SERVER_VARS['QUERY_STRING'] ) && $HTTP_SERVER_VARS['QUERY_STRING'] != ""
      
$url .= '?'.$HTTP_SERVER_VARS['QUERY_STRING']; 

    return 
$url;
  }
//function getURI()
  
  
function getPageStatus()  {
    global 
$HTTP_SERVER_VARS$HTTP_ENV_VARS;
    if (isset(
$HTTP_ENV_VARS['REDIRECT_STATUS'])) return $HTTP_ENV_VARS['REDIRECT_STATUS'];
    else if (isset(
$HTTP_SERVER_VARS['REDIRECT_STATUS'])) return $HTTP_SERVER_VARS['REDIRECT_STATUS'];
    else return 
'200';
  }
//function getPageStatus()
$status getPageStatus();
$url 'http://www.pcpropertymanager.com/botspotter/accept.php'
        
'?server=' urlencode$HTTP_SERVER_VARS['SERVER_NAME'])
        . 
'&uri=' urlencodegetURI())
        . 
'&agent=' urlencode$HTTP_SERVER_VARS['HTTP_USER_AGENT'])
        . 
'&ip=' urlencode$HTTP_SERVER_VARS['REMOTE_ADDR'])
        . 
"&account={$bsName}"
        
'&status=' $status;

$fp = @fopen($url"r") or die ("\n<a href='http://www.pcpropertymanager.com/botspotter/home.php' target='_blank'>Botspotter</a> <a href='{$url}'>disabled</a>\n");
if (
$fp != false) {
  
fpassthru($fp);
  
fclose($fp);
}

$url 'http://www.pcpropertymanager.com/botspotter/accref.php'
        
'?server=' urlencode$HTTP_SERVER_VARS['SERVER_NAME'])
        . 
'&uri=' urlencodegetURI())
        . 
"&account={$bsName}"
        
'&ref=' urlencode($HTTP_SERVER_VARS['HTTP_REFERER']);
        
fclose(fopen($url'r'));
?>
Opti is offline   Reply With Quote
Old 2004-03-25, 11:59 AM   #2
Opti
I Didn't Do It
 
Opti's Avatar
 
Join Date: Aug 2003
Location: au
Posts: 795
Send a message via ICQ to Opti
oops forgot URL Bot Spotter
Opti is offline   Reply With Quote
Old 2004-03-25, 01:02 PM   #3
swedguy
Vagabond
 
swedguy's Avatar
 
Join Date: Aug 2003
Posts: 2,374
Send a message via ICQ to swedguy
Split the first line up on two lines and it will work.
You have to either have a space between the start tag and the comment or put the comment on a separat line.

PHP Code:
<?php// Script Date: 09 Jan 2004
change it to:

PHP Code:
<?php
// Script Date: 09 Jan 2004
swedguy is offline   Reply With Quote
Old 2004-03-25, 03:44 PM   #4
Opti
I Didn't Do It
 
Opti's Avatar
 
Join Date: Aug 2003
Location: au
Posts: 795
Send a message via ICQ to Opti
Quote:
Originally posted by swedguy
Split the first line up on two lines and it will work.
You have to either have a space between the start tag and the comment or put the comment on a separat line.

PHP Code:
<?php// Script Date: 09 Jan 2004
change it to:

PHP Code:
<?php
// Script Date: 09 Jan 2004
Thanks.. I tried that before posting and it didnt help :\

I suspect it is a php version problem.

It just seems weird that it wouldnt work as is on any php platform the way they "market" it... designed to be a simple cut n paste solution any webmaster can use.

there isnt any mention of compatibilty issues in the faq and my linux with php4x platform isnt unusual.. I dont care enough to break my neck trying to make it work anyway.. there is plenty of other options.... I just wanted to test their admin analysis of my bot traffic which looked quite cool :\
Opti is offline   Reply With Quote
Old 2004-03-25, 05:34 PM   #5
swedguy
Vagabond
 
swedguy's Avatar
 
Join Date: Aug 2003
Posts: 2,374
Send a message via ICQ to swedguy
Strange. It works on my PHP4.3.0.

The error implies that something is wrong before line 3. There's only comments on those lines, so are you sure you reuploaded the file after you changed it?
swedguy is offline   Reply With Quote
Old 2004-03-25, 08:34 PM   #6
Entreri
WHO IS FONZY!?! Don't they teach you anything at school?
 
Join Date: Feb 2004
Posts: 42
I concur with Swedguy. I tried your code "as-is" and got the error :

Parse error: parse error, unexpected T_VARIABLE in X:\apache\htdocs\boo.php on line 4

Then, I separated the <?php from the comment and it works.

Entreri.
Entreri is offline   Reply With Quote
Old 2004-03-26, 06:05 AM   #7
Opti
I Didn't Do It
 
Opti's Avatar
 
Join Date: Aug 2003
Location: au
Posts: 795
Send a message via ICQ to Opti
Ok.. I obviously have hackers.. someone broke in and changed something on my server!! |bat|

As you guys say, it does work with that comment moved down a line.

That really was the first thing i tried... I must have stuffed up the file upload or something :\

Thanks very much for the help Swedguy... and to you for taking the time to try it Entreri

I didnt realise it before, but it inserts a small graphic in the page..
Opti is offline   Reply With Quote
Old 2004-03-30, 01:01 AM   #8
swedguy
Vagabond
 
swedguy's Avatar
 
Join Date: Aug 2003
Posts: 2,374
Send a message via ICQ to swedguy
Damn those hackers

Good to see that it's working now
swedguy is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:08 AM.


Mark Read
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc