Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run url in background in php

Tags:

url

php

In my application i have to send the sms to user while registration. But while inserting record in database i want to hit this url in browser.

Can any one suggest how to run this url at backgound

http://www.myurl.com/smpp/sendsms?username=XX&password=XX&to=XX&from=XX&text=Test

like image 706
CodePlateau Avatar asked Feb 05 '13 13:02

CodePlateau


1 Answers

Well this depends on what you mean with background I'm asuming however that you mean that the user won't be redirected to that page.

If I were you I'd go with cURL if you have it installed, since the only thing you seem to want to do is make an ordinary request, and maybe, read the response. The code below is untested but should give you a hint.

$req = curl_init();
curl_setopt($req, CURLOPT_URL,"theaddress_and_params");
curl_exec($req);
like image 128
Daniel Figueroa Avatar answered Sep 27 '22 21:09

Daniel Figueroa