...

View Full Version : Send text message using external website



eeijlar
07-29-2008, 12:31 PM
Hi,

I want to call this URL in PHP to send a text message:

http://www.webtext.com/api/send_text.html?api_id=myid&api_pwd=mypwd&txt=test%20m
essage&dest=4471234567&tag=my%20test&delivery_time=200801181130

In the specification for the above:
http://www.webtext.com/downloads/webtext_http_api.pdf

it says that it is a GET method... any ideas?

/jlar

mlseim
07-29-2008, 02:35 PM
You didn't mention anything about a form where someone enters
the message, phone number, etc. ... so below is how to just use
PHP to send it to that URL.

It mentions that you can also use POST, directly from an online form.
You should be using HTTPS (SSL), as it looks like you're also sending
important ID information.



<?php

$url = "http://www.webtext.com/api/send_text...d&txt=test&#37;20message&dest=4471234567&tag=my%20test&delivery_time=200801181130";

header ("location: $url");

?>

eeijlar
07-29-2008, 03:11 PM
Hi,

Thanks for your reply... will that actuall put the url into the address bar? I would prefer if it did it behind the scenes. I don't want the user to see the text message being sent.

/jlar

mlseim
07-29-2008, 05:02 PM
I think there might be a way for Javascripting to deal with a submit button
on a form (with all hidden variables). When the page loads, the form gets
sent ... method="post" by using Javascripting. The user never sees the form,
and the form doesn't show up on browser ... BUT, the form is visible when the
user looks at the HTML source code.

There is also this (but look for some tutorials via Google):
http://us.php.net/fsockopen

We might be getting to a point where we need to know more about what
you're doing, how you're creating the messages, etc.

ohgod
07-29-2008, 06:12 PM
if you're considering js for that one of the nice things about the prototype library is the serialize function. you basically drop in the form name, tell if if you want it sent as post or get and it will do all the work for you.

eeijlar
07-30-2008, 05:19 PM
Here is how to do it.. Thanks everyone..

<?php

$curl_handle=curl_init();
curl_setopt($curl_handle,CURLOPT_URL,'http://www.webtext.com');
curl_exec($curl_handle);
curl_close($curl_handle);

?>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum