12, 1, thismon+1) set nextyear iif(nextmon==1, thisyear+1, thisyear) set lastmon iif(thismon-1 < 1, 12, thismon-1) set lastyear iif(lastmon==12, thisyear-1, thisyear) set nextmon mon(nextmon) set lastmon mon(lastmon) BANNER % REM RUN $REMIND -iHTML=1 -p $REMCAL %m %y | $REM2HTML --forwurl \"$PHP_SELF?month=[nextmon]&year=[nextyear]\" --backurl \"$PHP_SELF?month=[lastmon]&year=[lastyear]\" "; $descriptorspec = array( 0 => array("pipe", "r"), // stdin is a pipe that the child will read from 1 => array("pipe", "w"), // stdout is a pipe that the child will write to 2 => array("file", "/tmp/error-output.txt", "a") // stderr is a file to write to ); $process = proc_open("$REMIND - $month $year", $descriptorspec, $pipes); if (is_resource($process)) { fwrite($pipes[0], $REMSCRIPT); fclose($pipes[0]); while (!feof($pipes[1])) { echo fgets($pipes[1], 1024); } fclose($pipes[1]); // It is important that you close any pipes before calling // proc_close in order to avoid a deadlock $return_value = proc_close($process); } ?>