Jump to content

open url without redirecting


greatchap
Go to solution Solved by 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
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"?

Edited by requinix
Link to comment
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.