Results 1 to 5 of 5

Thread: Need some help with a php restrict IP range

  1. #1
    Join Date
    Sep 2014
    Location
    Bratislava, Lamačská cesta
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Need some help with a php restrict IP range

    Hi all,

    need some help with my wordpress site & how to restrict access to it to specific IP range.

  2. #2
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    What have you tried already?

    Are you able to use .htaccess instead?
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

  3. #3
    Join Date
    Mar 2010
    Location
    Florida
    Posts
    512
    Thanks
    9
    Thanked 61 Times in 59 Posts

    Default

    -DW [Deadweight]
    Resolving your thread: First Post: => EDIT => Lower right: => GO ADVANCED => Top Advance Editor drop down: => PREFIX:Resolved

  4. #4
    Join Date
    May 2014
    Location
    Warsaw, Poland
    Posts
    12
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Default

    The best is to use .htaccess.

    If you cannot restrict it within .htaccess, then you could use the following PHP code:

    PHP Code:
    <? 
    if (substr($REMOTE_ADDR != "128.123.154.15") { 
     echo 
    "Access not allowed!"
     exit(); 

    ?>
    where "128.123.154.15" is the IP address which is allowed

  5. #5
    Join Date
    Sep 2014
    Location
    Bratislava, Lamačská cesta
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Have access to .htaccess file, thank you

Similar Threads

  1. restrict dragging images to a div
    By khizar in forum JavaScript
    Replies: 2
    Last Post: 07-08-2009, 04:09 AM
  2. Restrict access to directory
    By Schmoopy in forum Other
    Replies: 7
    Last Post: 06-12-2009, 08:12 PM
  3. Resolved How do you restrict file uploads???
    By Dirt_Diver in forum PHP
    Replies: 4
    Last Post: 02-20-2009, 05:10 AM
  4. Restrict access to admin pages
    By vineet in forum PHP
    Replies: 4
    Last Post: 10-27-2008, 08:20 AM
  5. how to restrict the records in PHP..??
    By RRVARMA in forum PHP
    Replies: 2
    Last Post: 04-11-2008, 09:57 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •