Changing Users Access by Ip Address in Login System on PHP and MySQL
===

Good day guys,

this should be the most difficult system that I will implement. So please help me regarding this system. Here is the flow of the system:

The user will login to the website using his/her computer in the office. But what if he/she wants to access it outside the office? When the user wants to access the website outside the company, the system will not permitted to access the user to the website. but it will prompt him/her a dialog box box says "Please contact MIS (075) 653-3106). Now once the user call the MIS, the admin of the website will accept the user request then the admin give a user registration page to the user to create a new user access.

When the user registered his/her user account, the admin will verify the user and the user can access the website outside the company. When the user want to access the website (this time the user is in the office) he/she will do again on what i've said (please contact mis, verify, user registration).

The problem is that to successfully implement this, the system will verify an ip address of the computer that the user will use to access the site. Once the user access the website, the computer that he/she will use is must match the registered ip address on the system to the ip address of the computer that he/she is using. When the user wants to access outside the company. The admin will give a user registration page but it will register a new ip address of the computer and it will change the ip_address value together with the username and password value on the mysql database so that the user access and the new ip address will be registered on the system so that the user can access the website outside the company. Same goes if the user will use his/her computer on the office.

I am using php and mysql database so can you please help me with these. It is a very complicated system so i really need help on how to do this.

Thanks guys