[UPHPU] A little if-then help...

John johnh at strictlyrockymountain.com
Fri Apr 23 19:06:26 MDT 2004


Hey there Ash, your "OR" is wrong.  Use "||" and you could get complicated
if ($k == "Phone_Number" || $k == "Cell_Phone").

--
Thanks
John

> Consider the following:
>
> foreach($_POST as $k=>$textfield1)
> 	{
> 	if ($k == "Phone_Number" or "Cell_Phone")
> 		{
> 		...
> 		do some pdflib stuff
> 		...
> 		}
> 	}
>
> So I just want the "do some pdflib stuff" to happen if $k ==
> "Phone_Number" or "Cell_Phone" . If it equals anything else, just
> continue on in the foreach until it finishes.
>
> "Phone_Number" and "Cell_Phone" are field names in the form I'm posting
> from and when I do a print $k, it says Phone_Number or Cell_Phone
> respectively.
>
> What really happens, though, is that it prints all of the $POST data
> onto the form. If I leave out the or, ie if ($k == "Phone_Number") ,
> then it works as I'd expect it to.
>
> Any suggestions?
>
> Ash
>
>
>
> --------------------------------------------------------------------- To
> unsubscribe, e-mail: list-unsubscribe at uphpu.org
> For additional commands, e-mail: list-help at uphpu.org






More information about the UPHPU mailing list