In the ThinkPHP framework, a page needs to be accessed regularly every day. the server is linux and there are logon restrictions during access. how can I solve the problem of running a PHP program to process data every night?
Currently, it is written in a PHP page in the project framework to access the wget page for linux scheduled tasks.
How can we solve the problem of better implementation of scheduled execution?
Reply to discussion (solution)
Remove the logon restriction and add an IP address in the header to determine that access is not allowed as long as the local IP address is unavailable.
Is my program restricted?
Remove the logon restriction and add an IP address in the header to determine that access is not allowed as long as the local IP address is unavailable.
Because this page is within the project, you cannot remove the logon restrictions for the entire project. if there is a way to remove the current page (inherit Class a and verify whether to log on in class a _ initialize method) can also be used for logon verification
Remove the logon restriction and add an IP address in the header to determine that access is not allowed as long as the local IP address is unavailable.
Because this page is within the project, you cannot remove the logon restrictions for the entire project. if there is a way to remove the current page (inherit Class a and verify whether to log on in class a _ initialize method) can also be used for logon verification
You can directly put this piece in a model or module.
If you cannot change the password and want to log on, you can blacklist yourself, or add a backdoor or an exception to the program.
1. you can use Curl to simulate login
2. remember the login information of an account, get its cookie, use CURLOPT_COOKIE in curl, and then directly access
I think this is a bit difficult for you. generally, if a URI is only displayed in the database operation department, you can simply write a script and run it yourself. why do you have to rely on the original framework? If part of the logic is based on the framework, you can just extract and copy one. it means that automatic script execution will not consume much resources.
I think this is a bit difficult for you. generally, if a URI is only displayed in the database operation department, you can simply write a script and run it yourself. why do you have to rely on the original framework? If part of the logic is based on the framework, you can just extract and copy one. it means that automatic script execution will not consume much resources.
1. you can use Curl to simulate login
2. remember the login information of an account, get its cookie, use CURLOPT_COOKIE in curl, and then directly access
Remove the logon restriction and add an IP address in the header to determine that access is not allowed as long as the local IP address is unavailable.
Because this page is within the project, you cannot remove the logon restrictions for the entire project. if there is a way to remove the current page (inherit Class a and verify whether to log on in class a _ initialize method) can also be used for logon verification
You can directly put this piece in a model or module.
If you cannot change the password and want to log on, you can blacklist yourself, or add a backdoor or an exception to the program.
Is my program restricted?
The solution is simple. I thought too much before adding the controller and method to the exclusion list when determining whether to log on...