greatchap Posted July 31, 2014 Share Posted July 31, 2014 Hi Guys, I have a Url which allows me to send sms to a number. The url usually asks for id , number and few other things. When I paste the url in browser and press enter it opens and a sms is sent. Now I want to code in php a way to send sms without redirecting to that page. For e.g. I ask user his mobile number and then I should be able to call/run that url and a sms should be sent to his number. If I use php header then it redirects to that page. I have tried using file_get_contents and php cURL but it has not worked so far. Can you guys help me out ? Thank you, Cheers, GR Link to comment https://forums.phpfreaks.com/topic/290203-open-url-without-redirecting/ Share on other sites More sharing options...
requinix Posted July 31, 2014 Share Posted July 31, 2014 If simply pasting a URL into a browser is enough, file_get_contents() and cURL should totally do it. If they don't then there is some other requirement, such as cookies, or a set of prohibitions, like sniffing for bot user-agent strings. What was the code? And how did it "not work"? Link to comment https://forums.phpfreaks.com/topic/290203-open-url-without-redirecting/#findComment-1486557 Share on other sites More sharing options...
SergeiSS Posted July 31, 2014 Share Posted July 31, 2014 I think I understand what you like to do. 1. Use normal AJAX. 2. Another possibility - iframe, hidden iframe. Just create your URL (in JS) and set iframe's SRC equal to this URL. Script will be loaded into this iframe. Moreover, you may send some JS commands from iframe to the main frame in order to get the feedback. Link to comment https://forums.phpfreaks.com/topic/290203-open-url-without-redirecting/#findComment-1486566 Share on other sites More sharing options...
greatchap Posted August 1, 2014 Author Share Posted August 1, 2014 Hello Guys, The SMS vendor gave me php code which working using cURL. I tried and it did the job. Thank for your help. Cheers, GR Link to comment https://forums.phpfreaks.com/topic/290203-open-url-without-redirecting/#findComment-1486597 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.