long loop and ajax
long loop and ajax
hi all i have problem in huge looping by using ajax
i have a list of emails around 150k in list box
<select id="emails">
<option value="a@a.com">a@acom</option>
<option value="b@a.com">b@acom</option>
<option value="c@a.com">c@acom</option>
<option value="d@a.com">d@acom</option>
............
.........
.......
</select>
<input type="button" value="Submit" onclick="FilterEmail();"/>
this is my html code
and javascript code is
<script language="javascript">
function FilterEmail() {
jQuery.each($('#emails').val(),function(i,val) {
DoProcessing(i,val);
});
} //function close
function DoProcessing(i,val) {
jQuery.ajax({
type: "POST",
url: "ajax.php",
data:"action=addemail&email="+val+"&groupid=<?=$_POST["group"];?>", success: function(html){
$('#e_status').html(i + " " + html);
}
});
} //function close
here is my php code
if ($_POST["action"]=="addemail") {
$con->execute("insert into emaillist(groupid,email,name,submitdate) values (".$_POST["groupid"].",'".$_POST["email"]."','','".date("Y-m-d")."')");
}
the problem is the loop is stopping at 8000 i dont no what i m doing wrong
but the list if is more then that
can you please help me out
Thanks
Regards
Mubbasher Adeel
www.etechsolution.de