Forum Moderators: coopster

Message Too Old, No Replies

bypassing users login by ip address into the main site

         

tecun

3:57 pm on Apr 24, 2009 (gmt 0)

10+ Year Member



Greetings,

So thankful for this site, hopefully you guys can help me in anything possible. A bit on the history of the request, I was requested by my employer to setup a site with a list of learning modules that will be referred to within a third party web application. Now this web application will have the various links listed on their site according to specific learning needs. What I’m trying to do is develop a login page where users of the web application could click on a link and this link will redirect the user within the external website with all of the modules and the user WILL NOT have to login because the script will be able to validate them on their IP address. However anyone else that goes around and wants to go in directly into the website with the training will be prompted with a user login and password. Also I would like to stick to php for this I know there is some similar requests in the past where people have used htaccess I don't have a clue about even how to go about that so I am basically just staying away.

Thank you and greatly appreciated

coopster

2:21 pm on May 5, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



What if the external user is on a dynamically changing IP? If you are certain the IP is going to be the same, say, coming from a network using a static IP at the firewall or something, you could use PHP's $_SERVER['REMOTE_ADDR'] variable to check the IP.

You may have to offer some more clarification/details ...

tecun

10:18 pm on May 5, 2009 (gmt 0)

10+ Year Member



Thank you for your response Coopster greatly appreciated. Well the site that will be hosting the trainning modules is capable of setting up a link to my site. My site will decipher the incoming request based on ip address to allow entry or deny entry. I apoligize for the initial comment it is a bit hard to follow. I may have to read further into using the $_SERVER['REMOTE_ADDR']function.

coopster

2:57 pm on May 6, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



It's not a function, tecun, it is one of PHP's Predefined Variables [php.net].