Welcome! Log In Create A New Profile

Advanced

how to ignore my counter?

Posted by fbrentan 
how to ignore my counter?
August 25, 2009 03:10AM
First. I´m sorry for my english.

I have a template for site.
In template, i have a php code with counter based in mysql.

The Problem.... whem index my site the counter is increase in many numbers.....

how to ignore parts of my code. Not for indexing.

Example:

<?php
require_once ('include/func_db.php);
echo 'test';
//ignore for indexint
<--ignore_execution>
require_once ('include/counter.php);
<--/ignore_execution>
echo '<header> test</header>;
.....
.....
....


?>

I´m try to create a $_session in auth.php for spider.php but when spider.php run, the session is ignored in counter.php and increase my counter

thanks and i´m sorry for my english
Re: how to ignore my counter?
August 25, 2009 03:00PM
I dont think this is really Sphider question, you have to do it in your counter software. For example, add an extra check, so that if the User-Agent string matches Sphider's, you ignore the "hit".
Re: how to ignore my counter?
August 25, 2009 03:27PM
Ando, thanks!

But i try to create extra check im my counter.php. the code is here.

in auth.php...

if (($username == $admin) && ($password ==$admin_pw)) {
$_SESSION['admin'] = $username;
$_SESSION['admin_pw'] = $password;
session_register('sphider');
$_SESSION['sphider'] = 'True';
}

AND in counter.php

if (session_is_registered('sphider')) {
echo '<script type="text/javascript">
alert(' . chr(39) . 'ignore' . chr(39) . ')
</script>;';
} else {
// pega pagina de destino
$pg_dest = getenv('REQUEST_URI');
// increase the counter
...........
}

when i access system login in the sphider, and go back to my site via browser, the system return the message "ignore" ....
but when spider.php run, the sphider ignore this check and increase my counter.....
Re: how to ignore my counter?
August 25, 2009 04:10PM
Use User agent instead of sessions
Re: how to ignore my counter?
September 01, 2009 12:56AM
I solve the problem.

I include in counter.php.....

session_start();

$t=$_SERVER['HTTP_USER_AGENT'];
if ($t=='Sphider') {
//not increase counter
} else {
// increase counter
....
....


Thanks
Sorry, only registered users may post in this forum.

Click here to login