Re: Re: .inc files doubles up

From: Date: Tue, 29 Oct 2002 17:48:00 +0000
Subject: Re: Re: .inc files doubles up
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-121912@lists.php.net to get a copy of this message
"Martin Hudec" <corwin@corwin.sk> wrote in message news:18910327021.20021029184135@corwin.sk... > Hello Tine, > > it looks okay to me but....looks like you have met two conditions at > time ($sted == "") and ($telefon == "0")....why dont u make something > like this? > > if (empty($sted) || empty($telefon)) { > include header > if (empty($sted)){ > echo ....STED NOT FILLED... > } > if (empty($telefon)){ > echo .....TELEFON NOT FILLED... > } > include footer > } > > that checks value of both variables...checks if they are empty.... > that || means or...so if $sted or $telefon are empty it will display > your code.....first it will implement include header then he will > display what is not filled based on if...and finaly it will include > footer.... > > hope it helps Martin, thanks! I think I understood that...off to try it out, and will post here if it works out (or doesn't..heh) > T> if ($sted == ""){ > T> include("head.inc"); > T> echo("Du fylte ikke ut <span > T> class=\"formfelt\">sted</span>.<br> > T> <blockquote>&raquo; <a href=\"m_skap.html\" > T> class=\"linkdot\">Tilbake til > T> skjemaet</a></blockquote>"); > T> include("foot.inc"); > T> $Envoi = 0; > T> } > T> else { > T> $MailBody .= "Sted : $sted\n"; > T> } > T> if ($telefon == "0"){ > T> include("head.inc"); > T> echo("Du fylte ikke ut <span class=\"formfelt\">telefonnummeret</span> > T> ditt.<br> <blockquote>&raquo; <a href=\"m_skap.html\" > class=\"linkdot\">>Tilbake til skjemaet</a></blockquote>"); > T> include("foot.inc"); > T> $Envoi = 0; > T> } > T> else { > T> $MailBody .= "Telefon : $telefon\n"; > T> } > T> if ($epost == ""){ > T> include("head.inc"); > T> echo("Du fylte ikke ut <span class=\"formfelt\">e-postaddressen</span> > T> din.<br> <blockquote>&raquo; <a href=\"m_skap.html\" > class=\"linkdot\">>Tilbake til skjemaet</a></blockquote>"); > T> include("foot.inc"); > T> $Envoi = 0; > T> } > T> else { > T> $MailBody .= "E-post : $epost\n"; > > T> } > T> if ($kommentarer == ""){ > T> include("head.inc"); > T> echo("Du fylte ikke ut <span class=\"formfelt\">kommentarer</span>.<br> > T> <blockquote>&raquo; <a href=\"m_skap.html\" > T> class=\"linkdot\">Tilbake til > T> skjemaet</a></blockquote>"); > T> include("foot.inc"); > T> $Envoi = 0; > T> } > T> else { > T> $MailBody .= "Kommentarer : $kommentarer\n"; > > T> } > > > > -- > Best regards, > Martin mailto:corwin@corwin.sk >

« previous php.general (#121912) next »