ronsen Posted November 23, 2018 Share Posted November 23, 2018 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 Quote Link to comment Share on other sites More sharing options...
ginerjm Posted November 23, 2018 Share Posted November 23, 2018 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". Quote Link to comment Share on other sites More sharing options...
cyberRobot Posted November 29, 2018 Share Posted November 29, 2018 What API are you using? Have you looked at the documentation? If the API allows for more than one number, I'm guessing you would need to group the numbers in some way, like with an array. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.