I don't think this is quite what I am looking for because I am hoping to
issue an error message if more than one variable has a value of one. Sorry
for not including this as a stipulation.
Thanks -Charles
On Thu, 17 May 2001, elias wrote:
> I understand that you want to check if:
> > i need to do some error control in my script to make certain that one and
> > only one of these is set to "1". i am coming up with a very long
> > control structure:
> "One and Only One"
> okay, ...
>
> if ($add == "1") { // do the add job }
> elseif ($remove == "1") { // .... }
> elseif ($view == "1") { // .... }
>
> -elias
>
> <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > i have a php script that has three variables that could be set to "1"
> > depending on the values of a form being sent to the .php file.
> >
> > $add
> > $remove
> > $view
> >
> > i need to do some error control in my script to make certain that one and
> > only one of these is set to "1". i am coming up with a very long
> > control structure:
> >
> > if (($add="1") && ($remove="1") || ($add="1") && ($view="1") || etc...))
> >
> > is there a shorter method to do this? and can i break this up onto
> > multiple lines to make my code a bit cleaner? can i do something like:
> >
> > if (
> > ($add="1") && ($remove="1") ||
> > ($add="1") && ($view="1") ||
> > ($remove="1") && ($view="1")
> > ) {
> >
> >
> > Thanks! -Charles
> >
> >
> > --
> > **
> > There are two major products to come out of Berkeley:
> > LSD and UNIX. We don't believe this to be a coincidence.
> > **
> >
> >
> > --
> > 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]
> >
>
>
>
>
--
**
There are two major products to come out of Berkeley:
LSD and UNIX. We don't believe this to be a coincidence.
**
--
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]