5

I am facing one problem about 2 hour. Can anyone give the solution I will appreciate.

http://mydowmin.com/userdatapage.php Note: i do not want to access this page out side world using Curl function

how to avoid it this script

$ch=curl_init("http://mydowmin.com/userdatapage.php"); 
curl_setopt ($ch,CURLOPT_CERTINFO,1);
curl_setopt ($ch,CURLOPT_VERBOSE,1);
curl_exec($ch) or die;
print_r( curl_getinfo($ch) );

http://mydomain.com/datapage.php

I want to block the page for curl and file_get_content for access out side. If you access this url direct on browser it should be execute but should not in Curl and Fgc function.

DontVoteMeDown
  • 21,122
  • 10
  • 69
  • 105
Bikash Nayak
  • 187
  • 1
  • 2
  • 12

3 Answers3

2

Browser can be simulated easily. this is not possible
php curl: how can i emulate a get request exactly like a web browser?

Community
  • 1
  • 1
Avi Fatal
  • 1,550
  • 8
  • 8
2

You can't prevent that, instead of you can improve your security vulnerabilities.

Krish R
  • 22,583
  • 7
  • 50
  • 59
0

You can only block specific Ip addresses from accessing your site. Getting contents of a single page from your site by an Ip may not be an issue, but incase it grabs hundreds of pages. Check using awstats for Ip using more resources and block it using apache like this.

order allow,deny 

deny from 137 141 003 101 //the ip address

allow from all
TechPotter
  • 579
  • 8
  • 14