PHP How to prevent a page: was opened at the same time.
PHP How to prevent a page: Be opened at the same time .... What is the way to achieve it ... JS is ok. Thank you.
------Solution--------------------
Add the following code to the beginning of the program
PHP Code
$FN = __file__. ' Lock ', if (file_exists ($FN)) exit (' Access Denied '); File_put_contents ($fp, '); Ob_start (' unlock '); function unlock ($buffer) {g Lobal $FN; Unlink ($FN); return $buffer;}
------Solution--------------------
Well, you can't rely on session control, it's fraudulent.
Can only rely on the service side guarantee only open, flock file lock on it.
PHP Code
------Solution--------------------
The landlord may be doing a management system, because some management system will have special requirements or worry about the simultaneous insertion of the problem.
With the database bar, the core is
The IP (or user ID) and path of the currently open page are associated, just like a federated primary key.
Openuser Openpage
1 index.php
2 modules/user/user_list.php
3 modules/user/user_list.php//This is wrong, because User 1 already has the "modules/user/user_list.php" page open.
------Solution--------------------
Well, I was just worried that he wanted a man.have been"Open" case, do not let others "open" .....
Explore
The landlord may be doing a management system, because some management system will have special requirements or worry about the simultaneous insertion of the problem.
With the database bar, the core is
The IP (or user ID) and path of the currently open page are associated, just like a federated primary key.
Openuser Openpage
1 index.php
2 modules/user/user_list.php
3 modules/user/user_list.ph ...