2011-08-31 42 views
1

我有一個PHP腳本加載一個函數,它使用Curl將自己登錄到另一個網頁以獲取一些數據。此操作大約需要14秒,有些用戶可能會變得不耐煩。我有一個繁忙的裝載機來指示活動。將更新通知推回到PHP,同時調用函數

我已經看到了這在其他網站上,並想知道我需要實現以下什麼技術:

如何發送小的通知訊息傳回主站點,而PHP函數運行,以便用戶知道關於進展。

消息可能在以下形式:

Logging in to website 
Extracting data 
Sorting data 
Closing connection 
+0

你開到使用JavaScript? –

+0

絕對。我不得不承認,在使用它的過程中我並不熟練,但非常願意學習。 –

回答

1
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. 
+0

聽起來很有希望,謝謝Sathish。 –