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("$[EMAIL PROTECTED]", $subject, $message,
    "From: $from_address\nReply-To: $to_address\nX-Mailer: PHP/" . phpversion());
}
else if (($prefix == "073") || ($prefix == "083")) {
  mail("$[EMAIL PROTECTED]", $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:[EMAIL PROTECTED]]
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to