473,386 Members | 1,817 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Anti Leech php script

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

Oct 6 '07 #1
8 2824
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.
js*******@attglobal.net
==================
Oct 6 '07 #2
-----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-----
Oct 6 '07 #3
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
Oct 6 '07 #4
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

Oct 6 '07 #5
-----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 <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-----
Oct 7 '07 #6
On Sat, 06 Oct 2007 23:34:44 +0200, AlBen <ca*******@hotmail.comwrote:
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
Oct 7 '07 #7
On 6 Oct, 22:34, AlBen <caspio...@hotmail.comwrote:
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.

Oct 7 '07 #8
Thanks a lot chaps for your answers.

Oct 8 '07 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: John Smith | last post by:
Hi, I've been trying to play around with a simple script to stop people stealing images (and bandwidth) but without much success : strFolder="imageshidden" strServer =...
0
by: Jason | last post by:
Hi guys, I am having problems with VML. I had been working on a problem for sometime now, and I just recently discovered what the problem really was: VML was anti-aliasing my rectangles, but I...
7
by: Maxim Shemanarev | last post by:
I'd like to announce my project called Anti-Grain Geometry. http://www.antigrain.com Anti-Grain Geometry (AGG) is an Open Source, free of charge graphic library, written in industrially standard...
17
by: rgoya | last post by:
Peace be with you! About a year ago, I created a JavaScript which turns any web site into an online anti-war protest: http://www.geocities.com/rgoya/javascript/PROTEST.HTM I have recently...
3
by: Michel | last post by:
Is there a way I can anti-aliasing a gif to be able to get a hi-quality resizeable backgroundpicture. When a GIF of JPG is being resized by the browser you get wurse pictures because it needs a...
6
by: bissatch | last post by:
Hi, I want to display text on screen with anti aliasing to make it appear smoother. Is it possible to do this in browsers by perhaps applying a style to it or is it entirely up the the browser?...
22
by: Martin Eyles | last post by:
Hi, I have some text on a page in a small font. The font size has been OK in other applications, but in a web browser, the legebility suffers due to the anti-aliasing. Is there a way to turn off...
4
by: Mike | last post by:
Hi, I took an interest a few months ago in an anti framebreaker javascript. All my research told me that it was impossible. If a website is loaded into a frame/iframe then if it has frame...
6
by: Roderik | last post by:
Hi, On my website I implemented tooltip alike layers when you hover the category items in the sidebar on the right. See: http://www.roderik.net/ The layers that become visible have a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.