开发者

Run a url to send sms in the background?

开发者 https://www.devze.com 2023-03-05 21:12 出处:网络
when I approve an o开发者_运维问答rder, it redirects to a confirmation page which adds details to dbase, send email etc... Now, I want that to also send sms automatically by loading the gateway url

when I approve an o开发者_运维问答rder, it redirects to a confirmation page which adds details to dbase, send email etc... Now, I want that to also send sms automatically by loading the gateway url the url open in browser but I want it to run in the background.

For now, I put a link where I click and it opens in new browser...

Please help


If I understand correctly you send the SMS by opening an URL. You could achieve this by opening the url with cURL in a php file:

// create a new cURL resource
$ch = curl_init();

// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, "http://www.example.com/");

// grab URL and pass it to the browser
curl_exec($ch);

// close cURL resource, and free up system resources
curl_close($ch);

for more info see: http://php.net/manual/en/function.curl-setopt.php


See Asynchronous PHP calls - this should be what you need.


You can use Tasks module for delayed (background) execution.
You can put there sms and email sending, and your main page will not have to wait their execution.


It may not be what your looking for but is worth mentioning. Why dont you just CC the email to your carriers SMS email?

T-Mobile: phonenumber@tmomail.net
Virgin Mobile: phonenumber@vmobl.com
Cingular: phonenumber@cingularme.com
Sprint: phonenumber@messaging.sprintpcs.com
Verizon: phonenumber@vtext.com
Nextel: phonenumber@messaging.nextel.com

0

精彩评论

暂无评论...
验证码 换一张
取 消