gotornot Posted July 31, 2009 Share Posted July 31, 2009 I wonder if anyone can help. im looking to send data to another page yet not break a while loop. The other page needs to take the data and submit it to another script on an external site. All this needs to be done whilst the loop is still continuing. any ideas on commands? or how to do this? Ive done this but it breaks the loop i need to call a script in a different page so i can continue the while loop any ideas? $lookq = "SELECT * FROM adr2"; $lookr = mysql_query($lookq); while ($lookrow = mysql_fetch_array($lookr)) { $email = $lookrow["email"]; header("Location: http://mysite.co.uk/user-sub.php?referrer=9&email=$email"); } Quote Link to comment https://forums.phpfreaks.com/topic/168252-send-data-withought-breaking-the-loop/ Share on other sites More sharing options...
Errant_Shadow Posted July 31, 2009 Share Posted July 31, 2009 off the top of my head there's probably two things you can do, but they'll both open new windows/tabs, which might be a bad thing. a META redirect: echo '<META http-equiv="refresh" content="1;URL=http://mysite.co.uk/user-sub.php?referrer=9&email=' . $email . '" target="_blank">'; but this will dump HTML as your script processes. or you can try javascript: $email = $lookrow["email"]; ?> <script> window.open("http://mysite.co.uk/user-sub.php?referrer=9&email=<? echo $email; ?>"); </script> <?php } But since it sounds like what you wanna do is have a bunch of scripts all execute in the background while one primary script executes, you might be successful using flash. Bascially, flash can access your php file, have it query your database, then feed that info back to flash to take and send out to each external page without opening any new windows or redirecting anything till you want it to. Quote Link to comment https://forums.phpfreaks.com/topic/168252-send-data-withought-breaking-the-loop/#findComment-887460 Share on other sites More sharing options...
ignace Posted July 31, 2009 Share Posted July 31, 2009 http://us2.php.net/manual/en/function.ignore-user-abort.php Quote Link to comment https://forums.phpfreaks.com/topic/168252-send-data-withought-breaking-the-loop/#findComment-887471 Share on other sites More sharing options...
Q Posted July 31, 2009 Share Posted July 31, 2009 How bout some AJAX? Quote Link to comment https://forums.phpfreaks.com/topic/168252-send-data-withought-breaking-the-loop/#findComment-887502 Share on other sites More sharing options...
Adam Posted July 31, 2009 Share Posted July 31, 2009 Could use cURL.. Quote Link to comment https://forums.phpfreaks.com/topic/168252-send-data-withought-breaking-the-loop/#findComment-887514 Share on other sites More sharing options...
gotornot Posted August 6, 2009 Author Share Posted August 6, 2009 can no one help? Quote Link to comment https://forums.phpfreaks.com/topic/168252-send-data-withought-breaking-the-loop/#findComment-891993 Share on other sites More sharing options...
Adam Posted August 6, 2009 Share Posted August 6, 2009 People have suggested ideas, have you looked into them? Quote Link to comment https://forums.phpfreaks.com/topic/168252-send-data-withought-breaking-the-loop/#findComment-892013 Share on other sites More sharing options...
Errant_Shadow Posted August 9, 2009 Share Posted August 9, 2009 wait, I already said that, nevermind Quote Link to comment https://forums.phpfreaks.com/topic/168252-send-data-withought-breaking-the-loop/#findComment-893838 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.