Jump to content

open url without redirecting


greatchap

Recommended Posts

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

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"?

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.  

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.