how to control access
Posted on 2002-06-27
I have a program writen in php and mysql for a company that runs on their intranet. I can restrict access to the main part of the program using apache. My problem is in one part of the program it allows users to create a invoice base on products that are available. The problem is I want the program to only allow one person at a time access to this part of the program. So how do I go about this? It must ask the user for a username and password. Then it must know when they are done so it will make it avaiable again to others. I have concerns to what if the user doesn't exit properly or there computer crash the program must reconize this and log them off automaticlly. Maybe you could set a time limit.
Has anyone ever does this if so can you please tell me what you did and post any code if possiable.
I have never really used sessions or cookies in my scripts.