RE: [PHP-GENERAL] Re: [PHP3] BANAL :-(
| From: | Benton Jackson | Date: | Wed, 07 Jun 2000 13:41:21 +0000 |
| Subject: | RE: [PHP-GENERAL] Re: [PHP3] BANAL :-( | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-1207@lists.php.net to get a copy of this message | ||
The "else" only applies to the "if (radio1==1)" statement. I assume you want
it to include file2 if any of the radioX's are non-1?
Try this:
$isGood=true;
$i=1;
$Max=20;
while ($isGood && $i<=$Max) {
$var="Radio$i";
if ($$var!=1)
isGood=false;
$i++;
}
if ($isGood) {
include "file1";
} else {
include "files";
}
> -----Original Message-----
> From: Richard Lynch [mailto:richard@zend.com]
> Sent: Wednesday, June 07, 2000 2:18 AM
> To: php-general@lists.php.net
> Subject: [PHP-GENERAL] Re: [PHP3] BANAL :-(
>
>
> In article <39365420.5788499B@kud-kontrabant.si>, janez@kud-kontrabant.si
> (Janez Vrenjak) wrote:
>
> > I know that is silly but why won't the else statment work:
> > if ($Radio1==1){
> > if ($Radio2==1){
> > if ($Radio3==1){
> > if ($Radio4==1){
> > if ($Radio5==1){
> > if ($Radio6==1){
> > if ($Radio7==1){
> > if ($Radio8==1){
> > if ($Radio9==1){
> > if ($Radio10==1){
> > if ($Radio11==1){
> > if ($Radio12==1){
> > if ($Radio13==1){
> > if ($Radio14==1){
> > if ($Radio15==1){
> > if ($Radio16==1){
> > if ($Radio17==1){
> > if ($Radio18==1){
> > if ($Radio19==1){
> > if ($Radio20==1){
> >
> > include ('file1');
> > }}}}}}}}}}}}}}}}}}}} else {
> > include ('file2');
> > };
>
> Exactly how is it not working?
>
> You did count the }s correctly, right?...
>
> The ; after that last } is bogus but harmless, I think.