...

View Full Version : links that only you can access



gilgalbiblewhee
07-28-2008, 07:27 AM
I wonder if there is a way that there would be links which only you can access on your page?

Does this work?


$ip=$_SERVER['REMOTE_ADDR'];
//echo $ip;
if($_SERVER['REMOTE_ADDR']="your IP address"){
include("personallinks.php");
}

When I tested on my other computer I don't think it worked.

student101
07-28-2008, 08:29 AM
Why not just have a login system and based on username accesslevel gets to see certain links?

username => text
password => text
accesslevel => int (1,2,3,4,5,etc...)
Or try this:

//Assign the variable $ip which will be 127.0.0.1
$ip=$_SERVER['REMOTE_ADDR'];
//echo $ip;
if($_SERVER['REMOTE_ADDR']=="127.0.0.1"){
//include("personallinks.php");
echo "I'm allowed 127.0.0.1, 'cause my IP is held inside your allowed database";
}else{
echo "I'm NOT allowed $ip";
}

oesxyl
07-28-2008, 07:06 PM
I wonder if there is a way that there would be links which only you can access on your page?

Does this work?


$ip=$_SERVER['REMOTE_ADDR'];
//echo $ip;
if($_SERVER['REMOTE_ADDR']="your IP address"){
include("personallinks.php");
}

When I tested on my other computer I don't think it worked.

missing a '=', must be:


$ip=$_SERVER['REMOTE_ADDR'];
//echo $ip;
if($_SERVER['REMOTE_ADDR']=="your IP address"){
include("personallinks.php");
}

regards

BWiz
07-28-2008, 07:39 PM
It could also be the ip you trying to match.
Also, if I remember correctly, having only one equal makes the if statment always true and always execute?

gilgalbiblewhee
07-28-2008, 11:19 PM
Why not just have a login system and based on username accesslevel gets to see certain links?

username => text
password => text
accesslevel => int (1,2,3,4,5,etc...)
Or try this:

//Assign the variable $ip which will be 127.0.0.1
$ip=$_SERVER['REMOTE_ADDR'];
//echo $ip;
if($_SERVER['REMOTE_ADDR']=="127.0.0.1"){
//include("personallinks.php");
echo "I'm allowed 127.0.0.1, 'cause my IP is held inside your allowed database";
}else{
echo "I'm NOT allowed $ip";
}does the IP differ from one computer to the next? Or is it by internet connection?
Because both my computers seem to have the same IP!

BWiz
07-28-2008, 11:59 PM
If both of your computers are hooked up to the same internet connection, then the IP will be the same.

gilgalbiblewhee
07-29-2008, 05:42 AM
Oh I didn't know that. Then it would be safe to use that script.

BWiz
07-29-2008, 05:48 AM
I would rely on a login based system, I think IPs can be faked - look at proxies.

gilgalbiblewhee
07-29-2008, 06:29 AM
I would rely on a login based system, I think IPs can be faked - look at proxies.

What do you mean by that?

BWiz
07-29-2008, 09:58 AM
In my opinion, a login based system would be more secure than something which relies soley on IP addresses. What happens if someone logs on to the web site from one of your computers, or somebody manages to gain access to your internet connection or system? I'm assuming that the links you are going to be posting are administrative links - what happens if you want to access them from somewhere other than your computer?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum