You are here: Re: Anti Leech php script « PHP Programming Language « IT news, forums, messages
Re: Anti Leech php script

Posted by James Barrett on 10/06/07 15:50

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

AlBen wrote:
> Hello guys
>
> I have a problem with my site
> I need a anti leech php script code
>
> I need to protect some external links on my pages
> I would like to find a simple script which will check from where are
> coming the request
> from my page or not.
>
> Thank you
>

Hi, I think I know what you are asking. If you have an index.php that
includes some other php file, (lets call it test.php) then in test.php,
you could test $_SERVER['PHP_SELF'] == '/index.php'. and if that fails,
you know someone is attempting to use test.php directly. if it passes,
you know it is from your index.php.

for example, your index.php would have something like this:

<?php
include_once('test.php');
?>


and then test.php would have something like this:

<?php
if($_SERVER['PHP_SELF'] != '/index.php')
{
die(' you leach!!!');
}
else
{
echo 'very good';
}

?>


try that out and let me know if that is what you are looking for.

Jim
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHB67NQuDJiZ/QrH0RAgIaAJ4hU2N8i3nYS24SjEOs83a712Ff6ACgyLcX
0pYazvgFUzg5LypIKULOdFc=
=pbi9
-----END PGP SIGNATURE-----

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация