php function:limit websites?
Hi all, I am a newbie in php, will be appreciated for any possible help.
Is there a function that I could limit the access gained only to a whole set of websites, eg: *.abc.com? A similar function to limit access by looking into the IPs: $ip=$_SERVER['REMOTE_ADDR'];
Thanks again.
Re: php function:limit websites?
How do you mean? Will people be using your script as sort of like a proxy? Or do you want your script to not be able to have access to these sites?
Could you explain to us what your goal is please?
Re: php function:limit websites?
Quote:
Originally Posted by
Slyke
How do you mean? Will people be using your script as sort of like a proxy? Or do you want your script to not be able to have access to these sites?
Could you explain to us what your goal is please?
Agreed. I am not sure i understand any part of the question...
Re: php function:limit websites?
You can use the function gethostbyaddr to look up an IP address in DNS.
Re: php function:limit websites?
Sorry for the uncleared question.
Ok, I have writen a php that return data in an xml form. But I want to restrict it to be availabe to website *.abc.com only, that means if the php is called by other website or someone else, it will not return any date. My client could not provide me any IPs as they could be changed without knowing, their hostname will not change: *abc.com, just wonder if I can get around it...
Re: php function:limit websites?
Thanks for your reply penagate---will have a look now! :)
Re: php function:limit websites?
sounds like you want to filter referers. they can be spoofed, but there doesn't seem to be much else you could do. you can access the referer using $_SERVER['HTTP_REFERER'], and use parse_url() to look at the host.