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

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.