Explaination;
I am trying to pass a variable from one page to another php page so far this is where I have got to;
Page One: Contains;
Code: Select all
<?
$var1 = "foobar";
exec("/usr/local/bin/php child_script.php $var1> /dev/null 2>&1 &");
if ($fp = fopen("log.txt", "a"))
{
fwrite($fp, "Main process finished at ".date("H:i:s", time())."!\n");
fclose($fp);
}
?>
child_script.php which contains;
Code: Select all
<?php
$thisVar = $var1;
sleep(10);
if ($fp = fopen("log.txt", "a"))
{
fwrite($fp, "$thisVar - Child process finished at ".date("H:i:s", time())."!\n");
fclose($fp);
}
?>
Help much appreciated!