Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

'REMOTE_ADDR' a safe protection?

Status
Not open for further replies.

ThomasJSmart

Programmer
Sep 16, 2002
634
is protecting a webpage with the following code safe?

<?
if ($_SERVER['REMOTE_ADDR'] != &quot;12.345.67.89&quot;){ exit;}
?>

i only need to acces this page from my home computer and i have a static IP address. The content of the page is for me only so is this a safe way of protecting my page?

thanks,
Thomas

I learned a bit yesterday, today i learned a lot, imagine what i'll learn tomorrow!
 
no...still better to use a password login or place the pages in a secured folder

Bastien

cat, the other other white meat
 
Well, that should accomplish your purpose, unless someone is able to hack your webserver or pollute the script's environment.

//Daniel
 
Hi,

If the ip is static that will work, if it's dynamic the user's ip will change.

If I were you I'd use .htaccess to protect a directory with sensitive infomation in it.

Hope this helps!

NATE


mainframe.gif


Got a question? Search G O O G L E for links to the fastest answers:
 
Thanks, for all the responses. I want to use the IP protection for the cms of my own site. as i will be the only one accessing it and i have a static ip and its also on my own (remote)server i thought this would be quite safe, but maybe i should add a pasword login for extra safety....

thanks,

I learned a bit yesterday, today i learned a lot, imagine what i'll learn tomorrow!
 
You might also want to just add an .htaccess file if you use Apache. In doing that it would be easy to implement basic authentication.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top