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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

auto log into a password protected directory?

Status
Not open for further replies.

techexpressinc

Programmer
Oct 28, 2008
67
US
We have an website with a folder that userid/password protected. Is it possible for to pass the userid/password to the server?

The situtation is that is the employee area. So, when the employees log-in from the office; they do not to enter the userid/password. If they enter from some place other than the office we need them to enter the userid/password.

So, is there a way to can get the ip see the ip is the office ip then not require the password by passing it on to the server somehow?

Is this pie in the sky thinking?

Thanks for any help or direction.
Russ at techexpressinc.com
 
You could use some kind of client side script such as Javascript or Vbscript to get the login information or IP, and pass that over to the server. PHP would then be able to use that information to determine what action to take

However PHP cannot get the information directly it is a Server side language. Meaning it runs on the server and has no interaction with the client.



----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
PHP can easily get the user's IP with the $_SERVER['REMOTE_ADDR']. The concern that is left is whether or not the user is going thru a proxy that might mask the true user IP, but if they are all in the same network, the proxy IP could work if its static.

After the first logon, you could place a cookie on the users machine to check for next time.

Note that neither IP nor cookie are really secure authentication methods. If there is any sensitive data, you should use the same authentication as the other users.

Bastien

I wish my computer would do what I want it to do,
instead of what I tell it to do...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top