I’m trying to send user credentials via sms after registration.The gateway can be accessed using GET method via HTTP API.So I want to integrate it into my registration_process.php file so that as soon as the details are entered in db the sms should be delivered .
The GET method is similar to
http://gatewayprovider?user=<username>&password=<password>&msg=<$my msg>&no=<$receiver no>
So how can I call this url without any knowledge to the user. That is in a secure manner
Thanks.
You can you cURL, if it is installed and enabled on the webserver.
Slightly modified example from php.net
When you say
I can hardly believe sending the data in cleartext as a http GET request is safe.
The data will be invisble for the user, but anyone sniffing your data can read it. Does the gateway provide https?
Also sending data using
GET, opposed toPOSTmethod is not really safe, since the request url will be visible in the logs, thinking of firewalls and so on. This is of course on the route from your server to the sms gateway.If you SMS Gateway supports it,
POST+HTTPSwould be the best choice. cURL would also be an ideal choice to use here.In case you dont have cUrl installed, you can use wget, by calling a shell script.