PLEASE HELP sites abusing my service need to fix asap

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Locked
webmasterm
Forum Newbie
Posts: 6
Joined: Sun Sep 16, 2007 9:07 am

PLEASE HELP sites abusing my service need to fix asap

Post by webmasterm »

scottayy | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


the code below is currently what im using for the service I offer on my website

I want to block browser requests so requests only from websites get accepted!

Also the check link and link check function do not work just displays image backlink not found??? even when the backlink is

located on the page im initiating requests from... 

This is just to verify that sites have added a backlink to us on thier HOMEPAGE for our free service

Code: Select all

if ($_SERVER['REQUEST_METHOD'] == 'GET' && isset($_REQUEST['url'])) {
checklink();
} else {
}

function checklink() {
$requestedurl = parse_url($_SERVER['HTTP_REFERER']);
$remote = $requestedurl['host'];
$remote = str_replace( 'www.', '', $remote);
$link = 'http://mywebsiteaddress.com';
if (linkCheck($remote, $link)) {
start();
} else {
nobacklink();
}
}

function linkCheck($remote, $link ) {
$arrText = file($remote);
for ($i=0; $i<count($arrText); $i++) {
$text = $text . $arrText[$i];
}
if (eregi($link, $text)) {
return true; // set true if there is a backlink
} else {
return false; // set false if backlink is missing
}
}

scottayy | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

Don't double post.
Use

Code: Select all

tags.
Avoid using all caps.
Don't annoy me. 

You need to make your code easily readable, explain exactly what it does, and explain exactly what it's doing wrong.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

I want to block browser requests so requests only from websites get accepted!
How do "websites" send the http request to your server?
Can you limit them the specific ip ranges?
Or can you use e.g. a http basic authentication?
webmasterm
Forum Newbie
Posts: 6
Joined: Sun Sep 16, 2007 9:07 am

they basically are requesting an image thru a .php file

Post by webmasterm »

scottayy | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


but requests can be sent from the browser as well!

I want to be able to allow the file to only accept requests from website and not from the browser....

they can type in mywebsite.com/file.php?request=whatever and get a response from the browser....

have tried myself to block it and limit to websites only but can quite figure it out???

as far as the backlink part of it the code below works for my tracking system to track pages and sites requests are

initiated from and just grabs the host name (domain) but does not seem to work for the backlink checking???

Code: Select all

$requestedurl = parse_url($_SERVER['HTTP_REFERER']);
$remote = $requestedurl['host'];
$remote = str_replace('www.', '', $remote);

scottayy | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Re: they basically are requesting an image thru a .php file

Post by volka »

webmasterm wrote:but requests can be sent from the browser as well!
Yes. And there's next to nothing you can do about it.
browser=http client. Some script on the website server=http client.

How do "websites" send the http request to your server?
Can you limit them the specific ip ranges?
Or can you use e.g. a http basic authentication?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Duplicate thread. Locked.
Locked