RE: [PHP] changing a variable according to the input in a checkbox
| From: | Yoan Bosch [VDB TECH SUPPORT & DEVEL] | Date: | Tue, 27 Nov 2001 13:52:00 +0000 |
| Subject: | RE: [PHP] changing a variable according to the input in a checkbox | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-75779@lists.php.net to get a copy of this message | ||
Hi
I think if you want the user to type in a number, rather use a textbox, not a checkbox ;-))
Then call the textbox "phone" in the form you want the user to fill in, and when
submitted, the variable $phone will contain the number he typed in.
Then use:
$prefix = substr($phone, 0, 3);
if (($prefix == "072") || ($prefix == "082")) {
mail("$cellnum@voda.co.za", $subject, $message,
"From: $from_address\nReply-To: $to_address\nX-Mailer: PHP/" . phpversion());
}
else if (($prefix == "073") || ($prefix == "083")) {
mail("$cellnum@sms.co.za", $subject, $message,
"From: $from_address\nReply-To: $to_address\nX-Mailer: PHP/" . phpversion());
}
else if ($prefix == "084") {
mail("$cellnum@cellc's address", $subject, $message,
"From: $from_address\nReply-To: $to_address\nX-Mailer: PHP/" . phpversion());
}
Regards
Yoan Bosch
eStart Computer Services cc
http://www.estart-online.co.za
-----Original Message-----
From: Rudi Ahlers [mailto:kopspier@bigfoot.com]
Sent: 26 November 2001 14:04
To: PHP General
Subject: [PHP] changing a variable according to the input in a checkbox
How would I be able to change a variable from the input in a checkbox? I
need to write an sms script, that would be able to sms to three different
providers, and I only want the use to type in the phone number. Thus, if he
types in 083xxxxxxxxxx, it should goto provider 1, if he types in
082xxxxxxxxxx, it should goto provider 2, and if he types in 084xxxxxxxxxx,
it should goto provider 3. I have a simple mail script, with $phone for the
phone number variable, and this is the one that needs to change.
Rudi Ahlers
UNIX Specialist and Web Developer
Bonzai Web Design - http://www.bonzai.org.za
Cell: 082 926 1689
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net