This tutorial assumes that you have a variable, let's call it $admin, defined for a certain IP address or another way of identifying the veriable. For the quick way, here is how you would do that: PHP: $admin = $SERVER[REMOTE_ADDR]; Once you have added that code, you move on to dsiplaying the link, which would look something like this: PHP: <a href="index.php">Index</a> <a href="link.php">Link</a> <?php if $admin = 12.145.23.19 //here is your IP address, I just made one up for the purpose of this tutorial { ?><a href="protectedlink.php">Only 12.145.23.19 can see this</a> <?php } ?> <a href="morelinks.php">More links here</a> This will make that link only show up to that IP address. But, if you are a smart web designer, you know that your restriced page can then be accessed by typing in www.domain.com/protectedlink.php and the hacker will get to it fine. To prevent this, put this code into protectedlink.php: PHP: <?php //get the variable $admin working require_once("filewithvariable.php"); if $admin = 12.145.23.19 { //you would code your site into this area } else { echo "You are not allowed to access this page."; } Now, this will not work all of the time, the hacker can mask his IP address to be 12.145.23.19, but this is the first step to protecting your site. Further actions would have to be taken with password protecting, using either Javascript or PHP. This will work fine for a site that will not be experiencing any professional hacking attempts. Hope this helped
Simpler one is just: PHP: <?php if ($open){ // your page here } else { // refuse access here } ?> Before require, define $open.
No, it isn't be an IP; however, it is a boolean. It doesn't make too much sense to incorporate in IPs because if you're on a router (wireless) it changes (or at least the last digit). I never actually get what kind of site you would make to only allow yourself to view it. And it's in PHP so it's not like people will get the source script anyways. Aside from that, I'd just set a boolean or a log in system if the page is only for me.