How does PHP prevent a page .. How does PHP prevent a page from being opened at the same time .. Opened at the same time .... Is there any way to achieve this... JS .. Thank you ------ solution ------------------ Add the following code to the beginning of the program: PHPcode $ fn _ FILE __. lock; if (file_exists ($ fn) exit (Access Denied); how can fil PHP prevent a page .. Opened at the same time
How does PHP prevent a page .. Opened at the same time .... Is there any way to achieve this... JS .. 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) {global $ fn; unlink ($ fn); return $ buffer ;}
------ Solution --------------------
Well, it cannot rely on session control and can be fraudulent.
You can only rely on the server to ensure that the log is unique, and the flock file lock is enough.
PHP code
------ Solution --------------------
The landlord may be working on a management system because some management systems have special requirements or are worried about simultaneous insertion.
Use a database. The core is
The IP address (or user ID) must be associated with the path of the current open page, just like a primary key.
OpenUser openPage
1 index. php
2 modules/user/user_list.php
3 modules/user/user_list.php // This is incorrect, because User 1 has opened the "modules/user/user_list.php" page.
------ Solution --------------------
Well, I am worried that he wants a person.Already"Open" is not allowed to "open ".....
Discussion
The landlord may be working on a management system because some management systems have special requirements or are worried about simultaneous insertion.
Use a database. The core is
The IP address (or user ID) must be associated with the path of the current open page, just like a primary key.
OpenUser openPage
1 index. php
2 modules/user/user_list.php
3 modules/user/user_list.ph ......