0

I want to call a 3rd party URL, this URL is given to me by my SMS portal which is used to send SMS to end users.
Now the problem is that when I call this URL through PHP the state changes and I'm redirected to that page, is there any method by which we can call this URL again and again, the reason I want to call the URL so many times is because there can be 1000 users so in the URL I have to mention the name of the user and there phone number.
This process should be asynchronous.

3 Answers3

1

What about exec() ?

Something like:

$code = escapeshellarg("file_get_contents('http://www.site.com/etc...');");
exec("php -r {$code} > /dev/null 2>&1 &");

More info about those arguments.

Community
  • 1
  • 1
Alain Tiemblo
  • 36,099
  • 17
  • 121
  • 153
0

use CURL .See http://php.net/manual/en/book.curl.php for more details

user7282
  • 5,106
  • 9
  • 41
  • 72
0

You can make another script that will send the request and you can then run it from your main script with a shell command by appending & or | at now at the end of the command to move the process in to background.

Ranty
  • 3,333
  • 3
  • 22
  • 24