Jump to content

send data withought breaking the loop


gotornot

Recommended Posts

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");

}

Link to comment
https://forums.phpfreaks.com/topic/168252-send-data-withought-breaking-the-loop/
Share on other sites

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.