How to prevent my website being retrieved by someone else ?

Discussions of secure PHP coding. Security in software is important, so don't be afraid to ask. And when answering: be anal. Nitpick. No security vulnerability is too small.

Moderator: General Moderators

Barzouk
Forum Newbie
Posts: 4
Joined: Fri Mar 28, 2008 1:48 pm

Re: How to prevent my website being retrieved by someone else ?

Post by Barzouk »

idy wrote:OK I tried :

Code: Select all

 
$url = "http://www.petitscailloux.com/Follow.aspx?sUrl=http://www.seloger.com/199986/16271207/detail.htm";
ini_set('user_agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6');
echo file_get_contents($url);
 

I just tried your code. it is working.
idy
Forum Newbie
Posts: 12
Joined: Mon Sep 11, 2006 10:12 am

Re: How to prevent my website being retrieved by someone else ?

Post by idy »

Sorry about that - tried with my localhost, worked fine apparently (although not on my FTP and it works there fine with other URLs), but look carefully :
the value displayed by the file_get_contents to the right of "Nombre de jours" is different from the actual value when doing the direct http request (i.e. just browsing to the page). And every time I run my code, the value retrieved is different - how can that be ?

Thx !!
Barzouk
Forum Newbie
Posts: 4
Joined: Fri Mar 28, 2008 1:48 pm

Re: How to prevent my website being retrieved by someone else ?

Post by Barzouk »

what are you trying to do ?
Why not asking the webmaster to give you what you are looking for ?
Post Reply