Page 1 of 1

run php script

Posted: Wed Jun 07, 2006 9:18 am
by ilavos
I'm trying to run php scripts from within php scripts.Its a series of scripts that launch each other once they complete execution.But since they're in a loop,my browser stops execution saying it'll loop non stop.I use header() to do this.Is there a way to make my browser keep executing no matter what?

Posted: Wed Jun 07, 2006 9:30 am
by Deemo
would include() work?

Posted: Wed Jun 07, 2006 9:35 am
by ilavos
I'm not sure if include() could actually execute the script.I use it for functions,but i'm not aware of how it could be implemented to actually run the scrip.

Posted: Wed Jun 07, 2006 9:39 am
by ok
You can use fopen:

Code: Select all

<?php
$handle = fopen("http://myhost.com/myfile.php", "r");
$content = "";
while(!feof($handle))
{
  $content = fread($handle, 4096);
}
fclose($handle);
echo $content; //The result of "myfile.php" execution
?>
You also can send to "myfile.php" arguments, "myfile.php?id=1".

Posted: Wed Jun 07, 2006 9:42 am
by ilavos
Thanks i'll try that.I'll let u know how it works.