Create a form to send a text message
So, your API is activated for your account, and you've got Curl installed. Now it's time to build a simple example application. We're going to build a form to send a single text message. We'll submit the following information:
- The phone number we'll be sending our test message to.
- The message itself
- A subject (not required)
- Whether your message is Express or Standard
Copy and past this chunk of HTML into your favorite editor:
<style type="text/css">
.example { width: 300px; }
.example label { float: left; width: 100px; }
</style>
<div class="example">
<form name="example" method="post" action="send.php">
<label for="phone_number">Phone Number:</label><input type="text" maxlength="10" name="phone_number" id="phone_number" /><br />
<label for="subject">Subject:</label><input type="text" name="subject" id="subject" /><br />
<label for="message">Message:</label><textarea name="message" id="message"></textarea><br />
<label for="message_type">Express?:</label>
<select name="message_type" id="message_type">
<option value="1" selected="selected">Express</option>
<option value="2">Standard</option>
</select><br />
<input type="submit" value="Submit" />
</form>
</div>