|
-
May 18th, 2009, 08:29 PM
#1
Thread Starter
Lively Member
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.
-
May 18th, 2009, 10:23 PM
#2
Fanatic Member
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?
-
May 18th, 2009, 10:41 PM
#3
Re: php function:limit websites?
 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...
-
May 18th, 2009, 10:50 PM
#4
Re: php function:limit websites?
You can use the function gethostbyaddr to look up an IP address in DNS.
-
May 18th, 2009, 11:16 PM
#5
Thread Starter
Lively Member
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...
-
May 18th, 2009, 11:18 PM
#6
Thread Starter
Lively Member
Re: php function:limit websites?
Thanks for your reply penagate---will have a look now!
-
May 18th, 2009, 11:49 PM
#7
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|