I have gone though the tutorial of redis and php. i am currently using predis. I have three files named form.php, submit.php, and mail.php. in form.php i have a simple form. in submit.php i have written a simple code for display something. and inmail.php. i have written some code for sending mail. when i submit form in form.php then it should go on submit.php. and mail.php should start in background. I have written some thing like this:
submit.php
$client = new \Predis\Client();
$client->select(4);
$client->lpush('xxxx',$x['to']);
$arrOutput=shell_exec('php mail.php');
print_r($arrOutput);
in mail.php
require '/var/www/predis/autoload.php';
\Predis\Autoloader::register();
echo "hi";
require_once('Services/Notification.php');
$client = new \Predis\Client();
$client->select(4);
$u=$client->blpop('xxxx',0);
var_dump($u);
notification_on_signup($u[1]);
then please tell me how should i configure this thing. so that i can send mail.php in bakground
You can achieve what you want very easily. In most modern JS framework you can submit not only an asynchronous call to server, but also a callback function for success/failure.
Assuming you use
jQueryit would similar to this one:Check the docs.