Re: Re: .inc files doubles up
| From: | Martin Hudec | Date: | Tue, 29 Oct 2002 17:41:35 +0000 |
| Subject: | Re: Re: .inc files doubles up | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-121910@lists.php.net to get a copy of this message | ||
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
T> if ($sted == ""){
T> include("head.inc");
T> echo("Du fylte ikke ut <span
T> class=\"formfelt\">sted</span>.<br>
T> <blockquote>» <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
T> class=\"formfelt\">telefonnummeret</span>
T> ditt.<br> <blockquote>» <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
T> class=\"formfelt\">e-postaddressen</span>
T> din.<br> <blockquote>» <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
T> class=\"formfelt\">kommentarer</span>.<br>
T> <blockquote>» <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