Connecting Tech Pros Worldwide Forums | Help | Site Map

Anti Leech php script

AlBen
Guest
 
Posts: n/a
#1: Oct 6 '07
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


Jerry Stuckle
Guest
 
Posts: n/a
#2: Oct 6 '07

re: Anti Leech php script


AlBen wrote:
Quote:
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
==================
James Barrett
Guest
 
Posts: n/a
#3: Oct 6 '07

re: Anti Leech php script


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

AlBen wrote:
Quote:
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-----
Dikkie Dik
Guest
 
Posts: n/a
#4: Oct 6 '07

re: Anti Leech php script


AlBen wrote:
Quote:
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
AlBen
Guest
 
Posts: n/a
#5: Oct 6 '07

re: Anti Leech php script


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

James Barrett
Guest
 
Posts: n/a
#6: Oct 7 '07

re: Anti Leech php script


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

AlBen wrote:
Quote:
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 <iframetag? it
allows you to present an external web page within a frame of your web
page. So the user never leaves your web site.

Here are some links that descript the <iframetag.
http://www.htmlcodetutorial.com/frames/_IFRAME.html
http://www.w3schools.com/tags/tryit....tryhtml_iframe


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

iD8DBQFHCCpBQuDJiZ/QrH0RAmW7AKDNm43r2p50L6tWz3ESC4lHAKh/3wCdEYYl
FsazVPJnEnSxBCqr8MDwVvQ=
=EgpO
-----END PGP SIGNATURE-----
Rik Wasmus
Guest
 
Posts: n/a
#7: Oct 7 '07

re: Anti Leech php script


On Sat, 06 Oct 2007 23:34:44 +0200, AlBen <caspionet@hotmail.comwrote:
Quote:
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
C. (http://symcbean.blogspot.com/)
Guest
 
Posts: n/a
#8: Oct 7 '07

re: Anti Leech php script


On 6 Oct, 22:34, AlBen <caspio...@hotmail.comwrote:
Quote:
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-s...uest-forgeries

C.

AlBen
Guest
 
Posts: n/a
#9: Oct 8 '07

re: Anti Leech php script


Thanks a lot chaps for your answers.

Closed Thread