using javascript to loop php (ajax?)

  • Thread starter Thread starter GeX
  • Start date Start date

GeX

GeX

Soldato
Joined
17 Dec 2002
Posts
7,029
Location
Manchester
Hi all.

I have a web application that sends SMS via a bulk gateway. The following will echo out the status report of a sent message.

Code:
    $results = $api->messageStatus(array($msgID));

    foreach($results as $msgId => $msgInfo) {
        echo $msgInfo['status'];
        }

It can return the following;

Code:
q	intermediate	The message is queued on the TextMagic server.
r	intermediate	The message has been sent to the mobile operator .
a	intermediate	The mobile operator has acknowledged the message.
b	intermediate	The mobile operator has queued the message.
d	final	The message has been successfully delivered to the handset.
f	final	An error occurred while delivering message.
e	final	An error occurred while sending message.
j	final	The mobile operator has rejected the message.
u	final	The status is unknown.
s	intermediate	This message is scheduled to be sent later.

What I'd like to do is have this as part of the page that sent the SMS, and to constantly check the status until it reaches on of the 'final' states.

I'm not really sure how to go about doing that though.

Any pointers?
 
meh, prototype and Ajax.PeriodicalUpdater seems to working out ok for this.
 
Back
Top Bottom