Can anyone help me, i'm trying to write a mailing script which will run in the background so as not to time out.
I can run the following turtorial code from the shell interface but can't get it to work through a browser.
It doesnt throw up any errors it just wont send the mail.
Many thanks for any help.
// Send email
mail("mail_add@yahoo.com", "Forking Results", $message);
?>
//To trigger the fork. <?php passthru("/usr/bin/php forkedScript1.php Value1 $ip > test.txt &"); //exec("hello"); echo "<center>Hmm, maybe it forked, maybe it didn't get forked! Check your email to see!</center>"; print_r($_SERVER); ?>
//The forked script. <?php // Get arguments from the argv array $arg1 = $_SERVER['argv'][1]; $arg2 = $_SERVER['argv'][2]; // Build message $message = "Hi Dude,\n\n"; $message .= "This is the first argument that you have passed to the script $arg1 "; $message .= "and this is the second argument: $arg2\n\n"; $message .= "This is pretty cool huh?\n\n"; $message .= "Congrats, you have now forked PHP!\n";