PDA

View Full Version : php hitbot detection


flashingfrank
2006-06-12, 03:24 PM
i have a little php problem.

i just put some hitbot detection script on my tgp, but i cant get it to work right.

i inserted a couple of links on my index page with the following code:

<a href="http://domain.com/a/go.php?from=<? echo $_SERVER['HTTP_REFERER']; ?>"
class="proxy">free anal movies</a>

the link leads to go.php that has the following code:
<?
mail("proxy@domain.com", "Hitbot:", "From: $from\r\n");
?>

the variable is passed on to the go.php file, and the sending of the email is working fine, but the referer variable is not inserted in the mail.

anyone knows why it does not work?

matt
2006-06-13, 04:17 AM
A couple of things i noticed at a glance...

Maybe this:

<? echo $_SERVER['HTTP_REFERER']; ?>

Should be

<? echo urlencode($_SERVER['HTTP_REFERER']); ?>


Or possibly this:

mail("proxy@domain.com", "Hitbot:", "From: $from\r\n");

should be

mail("proxy@domain.com", "Hitbot:", "From: " . $_GET['from'] . "\r\n");


How do you know the variable is being passed to the go.php file?

kaktusan
2006-06-13, 06:37 AM
as matt said:
only the mail("proxy@domain.com", "Hitbot:", "From: " . $_GET['from'] . "\r\n");

should fix the problem i think, if your server does not support register_globals in the php, otherwise it should work fine..

flashingfrank
2006-06-13, 08:30 AM
thanks guys!
i changed the mail code and it works fine now :D