Execute web page scripts on a regular basis

recently, developers have encountered such a problem, that is, they hope to notify the customer service staff by mailbox when they submit an order. Think of two ways:

1:
2:24

Mar.18,2021

the way you use scripts, you don't have to visit the site.

  1. can develop a queue service, put the task of sending mail into the queue, and then use a daemon to listen to the queue all the time, and when the queue has data, it can be destacked and executed.
  2. write a script, such as send.php , that contains the logic code to send an email. When the customer submits the order, the sending email is triggered by executing a script in the logical code.
shell_exec('php send.php $param')
The

php function shell_exec is an asynchronous execution script, so you don't need to wait for the script to finish, and you can pass parameters.


you can consider using message queues


just use method 1

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b347b8-2bf2e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b347b8-2bf2e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?