Jump to content

Send Request


Awaken88

Recommended Posts

Hello!

 

I'm new to coding PHP, just trying to do a simple Web app for my work to make my job a bit easier.

Basically, it is an SMS app,

 

We have a company that we send SMS's through, which now has an API so i can just send a string straight to the site and it sends the message.

 

Basically i made a PHP script that takes some values from a page, mobile which i will enter, then select a template from a drop down box and hit send...

 

I have all that part working perfectly!!

 

Only problem is, i don't know where to start to send the final string (Url + $mob + $message) I'm guessing i need to make a function to do this, but as to where to start I don't have a clue.

 

I've seen a few places that have what I think i need, but i don't understand completely.

 

Any help would be appreciated.

 

Atm, I want to have

 

$messagesent = $SendText($url)

 

and get a responce to say that the message has sent fine or not.

 

My url is all configured how i would need it (meaning if i put it in my web browser it sends the message)

 

http://mysmssend.com/api-wrapper/messages.single?apikey=111222233333&apisecret=secret&mobile=Mobile&message=Message+Goes+Here&caller_id=xxxxxxxxxx

 

Is there any way I can just put that in there? It does redirect to another site once the API has been run..

 

and displays..

 

messages.single 1 2010-07-07 12:47:30 GMT 1278506850 GMT queued no list provided

 

Guess all i would want to know is that its been queued or that the process ran :)

 

Any help would be great! I understand i need to open sockets? Then send the info, but as what format the info needs to be is unsure.

 

Regards,

 

Richard

Link to comment
https://forums.phpfreaks.com/topic/207001-send-request/
Share on other sites

tried

 

$smsent = file_get_contents($url)

 

Doesn't work, just makes the web page hang?

 

I know that the $url is correct as i had it just post it to the page before.

 

Anything  I may be doing wrong?

 

And does file_get_contents need to be an actual file... as its not a file just a url.. ?

Link to comment
https://forums.phpfreaks.com/topic/207001-send-request/#findComment-1082437
Share on other sites

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.