Results 1 to 7 of 7

Thread: php function:limit websites?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2008
    Posts
    104

    Question 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.

  2. #2
    Fanatic Member
    Join Date
    Sep 2005
    Posts
    540

    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?

  3. #3
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: php function:limit websites?

    Quote Originally Posted by Slyke View Post
    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...

  4. #4
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: php function:limit websites?

    You can use the function gethostbyaddr to look up an IP address in DNS.

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Apr 2008
    Posts
    104

    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...

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Apr 2008
    Posts
    104

    Re: php function:limit websites?

    Thanks for your reply penagate---will have a look now!

  7. #7
    PowerPoster
    Join Date
    Sep 2003
    Location
    Edmonton, AB, Canada
    Posts
    2,629

    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
  •  



Click Here to Expand Forum to Full Width