Working behind the scenes

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
gotornot
Forum Commoner
Posts: 54
Joined: Fri Jul 31, 2009 2:30 am

Working behind the scenes

Post by gotornot »

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?

Code: Select all

 
$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?referr ... ail=$email");
        }
 
Last edited by Weirdan on Fri Jul 31, 2009 2:39 am, edited 1 time in total.
Reason: added [code=php] tags
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Re: Working behind the scenes

Post by Weirdan »

Depending on the situation something like this might work:

Code: Select all

 
 
$lookq = "SELECT * FROM adr2";
$lookr = mysql_query($lookq);
while ($lookrow = mysql_fetch_array($lookr))
        {
        $email = $lookrow["email"];
        file_get_contents("http://mysite.co.uk/user-sub.php?referrer=9&email=$email");
        }
 
gotornot
Forum Commoner
Posts: 54
Joined: Fri Jul 31, 2009 2:30 am

Re: Working behind the scenes

Post by gotornot »

I will take a look into that thanks is there any other commands that may do the trick?

I was thinking the page it calls executes a program and then outputs a result 1= accept 0= reject could that incorporate that?
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: Working behind the scenes

Post by Benjamin »

If you are able to do it with a GET request that's fine. Otherwise I would use cURL
gotornot
Forum Commoner
Posts: 54
Joined: Fri Jul 31, 2009 2:30 am

Re: Working behind the scenes

Post by gotornot »

no luck :banghead: :banghead:

I dont know why it wont work i just need to submit data on a seperate script?
Post Reply