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
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.