I have a table with ~500 rows, which will expand in the future.
In background.php
I create some PDFs and send them email and FAXs to each record of this table: this requires a certain amounts of time, which means I can not do the operation on a browser window or with an AJAX call.
Now I'd like to create a background process (exec() or shell_exec() or proc_open() or ...?) which iterate throght the table and sends FAXs and mails.
I don't need logs because the script has an internal log system.
I've tried something like
<form method="post" action="">
<input type="submit" name="background" value="go">
</form>
if(isset($_POST['background'])){
exec('php /WEB/mysite/.../.../htdocs/test/background.php &') or echo 'Error';
}
where background.php
is called from the user on the browser window!
I always get error but I don't know where and what error (probably errorS) I have!
I have no idea how to go forward...
EDIT Nobody on this site is able to answer my question properly? =(