Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Feb 2006
    Posts
    61
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Send text message using external website

    Hi,

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

    http://www.webtext.com/api/send_text...d&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

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,522
    Thanks
    8
    Thanked 1,091 Times in 1,082 Posts
    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 Code:
    <?php

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

    header ("location: $url");

    ?>

  • #3
    New Coder
    Join Date
    Feb 2006
    Posts
    61
    Thanks
    11
    Thanked 0 Times in 0 Posts
    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

  • #4
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,522
    Thanks
    8
    Thanked 1,091 Times in 1,082 Posts
    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.

  • #5
    Regular Coder ohgod's Avatar
    Join Date
    Jun 2008
    Location
    Ohio
    Posts
    579
    Thanks
    6
    Thanked 69 Times in 69 Posts
    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.

  • #6
    New Coder
    Join Date
    Feb 2006
    Posts
    61
    Thanks
    11
    Thanked 0 Times in 0 Posts
    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);

    ?>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •