Jump to content

PHP Help with variables


ronsen

Recommended Posts

Hello

I am stuck at a point where I need to call multiple numbers for a given API

 

This is the  code provided by the API company

// Send Message
$my_apikey = "APIKEY";
$destination = "NUMBER";
$message = "hellotest";
$api_url = "http://blahblah.com/send_message.php";
$api_url .= "?apikey=". urlencode ($my_apikey);
$api_url .= "&number=". urlencode ($destination);
$api_url .= "&text=". urlencode ($message);
$my_result_object = json_decode(file_get_contents($api_url, false));

 

Now My html code would be

 

<div class="card-header ch-alt">
        <h2>Test API</h2>
    </div>

    <div class="card-body card-padding">
        API Key: * <br>

         <option value='APIKEY'>APIKEY Value </option>            </select><br>
        
        Destination Number: * <br>
        <input class="form-control" type="text" id="test_number" required><br>

        <br><br>

        Text: * <br>
        <textarea class="form-control" id="test_text" required rows=5></textarea><br>
            </div>

 

 

Now how do I insert multiple numbers on the Destination number...when i give commas, it gives errors but the message goes with single number

 

Need hlp

Link to comment
Share on other sites

I see confusing things here.  LIke no form tag for your inputs, no <select> tag for your <option>.

So - what is this "Destination number" you are referencing?  I see you have assigned a text string to the $destination variable, but I see no other reference to a "destination".

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.