Anti Leech php script
am 06.10.2007 09:36:25 von AlBen
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
Re: Anti Leech php script
am 06.10.2007 16:46:19 von Jerry Stuckle
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
>
You can't. You have no access to any information on another site's
visitors.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Re: Anti Leech php script
am 06.10.2007 17:50:37 von James Barrett
-----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:
include_once('test.php');
?>
and then test.php would have something like this:
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/QrH0RAgIaAJ4hU2N8i3nYS24SjEOs83a712Ff6ACg yLcX
0pYazvgFUzg5LypIKULOdFc=
=pbi9
-----END PGP SIGNATURE-----
Re: Anti Leech php script
am 06.10.2007 18:49:43 von Dikkie Dik
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
>
I don't know what you mean exactly. If you want some links to be only
accessible from within your site (after logging in, for example), use a
session. In the session, you can set a variable that says a user is
logged in or a visitor has come through the site home page. This is not
restricted to html content, images can be created or sent from PHP as well.
Best regards
Re: Anti Leech php script
am 06.10.2007 23:34:44 von AlBen
Sorry
May be I'not so good at explanig things
But I think with a help of James I can already do something
It's simple
On may page I have a collection of external links (ex. cnn.com,
bbc.com and etc)
I would link to change my HTML links and to point not directly to
these sites but (now I think it's clear) with a check of the request
on the server.
By the way how open the link in a browser if all is ok?
I mean the user click a link, a part of PHP code checks on the server
and what after?
How to open it in a browser?
Sorry I'dont know much in PHP
Thakns to all of you
Re: Anti Leech php script
am 07.10.2007 02:37:21 von James Barrett
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
AlBen wrote:
> Sorry
> May be I'not so good at explanig things
> But I think with a help of James I can already do something
>
> It's simple
> On may page I have a collection of external links (ex. cnn.com,
> bbc.com and etc)
> I would link to change my HTML links and to point not directly to
> these sites but (now I think it's clear) with a check of the request
> on the server.
> By the way how open the link in a browser if all is ok?
> I mean the user click a link, a part of PHP code checks on the server
> and what after?
> How to open it in a browser?
>
> Sorry I'dont know much in PHP
>
> Thakns to all of you
>
Hi, maybe you want to try something like the HTML
Re: Anti Leech php script
am 07.10.2007 03:00:07 von luiheidsgoeroe
On Sat, 06 Oct 2007 23:34:44 +0200, AlBen wrote:
> Sorry
> May be I'not so good at explanig things
> But I think with a help of James I can already do something
>
> It's simple
> On may page I have a collection of external links (ex. cnn.com,
> bbc.com and etc)
> I would link to change my HTML links and to point not directly to
> these sites but (now I think it's clear) with a check of the request
> on the server.
> By the way how open the link in a browser if all is ok?
> I mean the user click a link, a part of PHP code checks on the server
> and what after?
> How to open it in a browser?
A pretty standard way to check 'outside links'.
Use a GET variable (post is possible, but unneccesary work) to a
redirection script, either hashed, plain, encrypted or unecncrypted,
whatever you like. In the redirection script, save everything from the
$_SERVER array you're interested in, and do the actual redirect by a
header redirect.
--
Rik Wasmus
Re: Anti Leech php script
am 07.10.2007 13:42:50 von colin.mckinnon
On 6 Oct, 22:34, AlBen wrote:
> Sorry
> May be I'not so good at explanig things
> But I think with a help of James I can already do something
>
> It's simple
> On may page I have a collection of external links (ex. cnn.com,
> bbc.com and etc)
> I would link to change my HTML links and to point not directly to
> these sites but (now I think it's clear) with a check of the request
> on the server.
> By the way how open the link in a browser if all is ok?
> I mean the user click a link, a part of PHP code checks on the server
> and what after?
> How to open it in a browser?
>
> Sorry I'dont know much in PHP
>
> Thakns to all of you
The solution would likely be implemented in PHP but your question is
all about HTTP and HTML.
It more commonly arises in discussions on CSRF (Cross Site Request
Forgery). There's an article and some sensible discussion about it
here:
http://shiflett.org/articles/cross-site-request-forgeries
C.
Re: Anti Leech php script
am 08.10.2007 07:52:33 von AlBen
Thanks a lot chaps for your answers.