调用函数时将更新通知推回PHP

调用函数时将更新通知推回PHP,php,notifications,Php,Notifications,我有一个PHP脚本,它加载一个函数,该函数使用Curl登录到另一个网页以获取一些数据。这个操作总共需要14秒,一些用户可能会变得不耐烦。我有一个小忙加载程序来指示活动 我在其他网站上看到过这一点,我想知道我需要什么技术来实现以下内容: 如何在PHP函数运行时向主站点发送少量通知消息,以便用户了解进度 消息可以采用以下形式: Logging in to website Extracting data Sorting data Closing connection 你愿意使用javascript吗

我有一个PHP脚本,它加载一个函数,该函数使用Curl登录到另一个网页以获取一些数据。这个操作总共需要14秒,一些用户可能会变得不耐烦。我有一个小忙加载程序来指示活动

我在其他网站上看到过这一点,我想知道我需要什么技术来实现以下内容:

如何在PHP函数运行时向主站点发送少量通知消息,以便用户了解进度

消息可以采用以下形式:

Logging in to website
Extracting data
Sorting data
Closing connection

你愿意使用javascript吗?当然。我必须承认,我对使用javascript一点也不精通,但我非常愿意学习。你愿意使用javascript吗?当然。我必须承认我对使用它一点也不精通,但我非常愿意学习。
You can do it using ajax, do the following.
1) Keep your curl code in the seperate php file.
2) While click the button, using js or jquery call that php file using ajax.
3) Before ajax return the reponse, you can display the div with your message, once you
got response, you can hide the div.