PDA

View Full Version : slowing sending data



intro
8 Sep 2010, 10:54 AM
Hi

is it possible to slow post sending data with ajax..I am having a scipt for sending e-mail in php and server will be slow if i send data to fast and mabe i get black list...

My situation,

Ajax send post data for each very fast, but i want ajax to wait a little bit, and send next, but timeout is not working.....

Thanks in advance...B)


Ext.each(selections, function (selection) {
Ext.Ajax.request({
method: "POST", timeout: 100000,
url: 'NewsletterHTMLDB.php',
params: {
id: selection.get('ID'),Newlsetterid: record.get('ID'),

}
});


});

darthwes
8 Sep 2010, 11:31 AM
Then build an array up like [{id, Newsletterid}, {id, Newsletterid}, {id, Newsletterid}].

Now write a function that sends off a request and recalls itself on teh success callback? You can then wrap the recurrant calls inside of setTimeout() if you're really wanting to introduce a delay ON PURPOSE...

Animal
8 Sep 2010, 12:44 PM
Why loop?

Build up one message and send ONE request.

intro
8 Sep 2010, 1:54 PM
Hi i made array and now i have post


Newlsetterid 59
id 4
id 3
id 2
id 1
Ok how can i now get data (id) with php?

Thanks in advance