sms/text messanger ** help please **
4 posts
• Page 1 of 1
sms/text messanger ** help please **
so i want to edit this code to allow for the user to select the service provider for the phone they want to text.
here is the code that i have so far. i need to change the "@messaging.sprintpcs.com " to look at a dropdown box using the currently selected provider as the domain to send the message to. and i am not sure how to make a dropdown box in php and link it. can anyone help out here.
- Code: Select all
// Process the form if it was submitted
if (isset($_POST['do'])) {
// Parse the data submitted from the form
$number = trim($_POST['number']);
$subject = trim($_POST['subject']);
$message = trim($_POST['message']);
// Check that the phone number is numeric
if (!is_numeric($number)) {
$error = "Please enter a phone number containing only digits 0-9.";
// Make sure the phone number doesn't start with 911
} elseif (eregi("^(911)(.*)$", $number)) {
$error = "Please enter a valid phone number.";
// Check that the phone number is 10 digits
} elseif (strlen($number) != "10") {
$error = "Please enter a phone number that is 10 digits (the 3 digit area code and 7 digit number).";
// Check that the subject doesn't contain HTML characters
} elseif (eregi("^(.*)(<|>)(.*)$", $subject)) {
$error = "The subject of the message cannot contain HTML characters (such as > or <).";
// Check that the message doesn't contain HTML characters
} elseif (eregi("^(.*)(<|>)(.*)$", $message)) {
$error = "The message cannot contain HTML characters (such as > or <).";
// Check that the subject is between 3 and 20 characters
} elseif ((strlen($subject) < "3") || (strlen($subject) > "20")) {
$error = "The subject must be between 3 and 20 characters in length.";
// Check that the message is between 3 and 120 characters
} elseif ((strlen($message) < "3") || (strlen($message) > "120")) {
$error = "The message must be between 3 and 120 characters in length.";
// Send the message
} else {
// Where are we sending it?
$to = "" . $number . "@messaging.sprintpcs.com ";
// Send the text message
if (@mail($to, $subject, $message)) {
// Give a success notice
echo "Text message sent.";
echo "</center>\n";
echo "</body>\n";
echo "</html>\n";
exit;
// Give an error if message can't be sent
} else {
$error = "Sorry, there was an error while trying to send the message - please try again later.";
}
}
}
// Show any errors encountered
if (isset($error)) {
echo "<font color="red\"><b>" . $error . "</b></font><br><br>\n";
}
Sorry for the delay but I have been "offline" for some time.
Would this work?
- Code: Select all
</option>
You could check this page too : http://www.felgall.com/htmlt20.htm
Best of luck!
Sorry for the delay but I have been "offline" for some time.
Would this work?
You could check this page too : http://www.felgall.com/htmlt20.htm
Best of luck!
Would this work?
- Code: Select all
// We make a select box form variable named 'menu'
// We want to have a dynamic item in that box selected
// Prepare the selection variable
unset($sel_menu);
unset($sel_menu2);
$sel_menu[$_POST['menu']] = "SELECTED";
// Print "SELECTED" in the proper option
// The other options will have blank values
echo "
<select>
<option>Default</option>
<option>Option1</option>
<option>Option2</option>
<option>Option3</option>
<option>Option4</option>
</select>
";
You could check this page too : http://www.felgall.com/htmlt20.htm
Best of luck!
Sorry for the delay but I have been "offline" for some time.
You might check here for an idea : http://isnoop.net/dev/drop_down.php
You could check this page too : http://www.felgall.com/htmlt20.htm
Best of luck!
You might check here for an idea : http://isnoop.net/dev/drop_down.php
You could check this page too : http://www.felgall.com/htmlt20.htm
Best of luck!
Last edited by NoReflex on Thu Oct 04, 2007 8:49 pm, edited 1 time in total.
4 posts
• Page 1 of 1
Return to HTML, CSS, and Scripts
Who is online
Users browsing this forum: No registered users and 1 guest