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

If its a fee service it is likely disabled. You can check via phpinfo.

 

You can  set error reporting up at runtime by placing the following at the top of all your scripts.

 

<?php error_reporting(E_ALL) ; ini_set('display_errors', '1'); ?>

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.