Re: [PHP] Re: .inc files doubles up
"Martin Hudec" <[EMAIL PROTECTED]> wrote in message news:18910327021.20021029184135@;corwin.sk... > Hello Tine, > > it looks okay to me butlooks 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 Ok, wrote the following code, but get a parse error line 74 (last part of the code): if (empty($navn) || empty($addresse) || empty($postnummer) || empty($sted) || empty($epost)) { include("head.inc"); } if (empty($navn)){ echo("Du fylte ikke ut navn. » Tilbake til skjemaet"); } if (empty($addresse)){ echo("Du fylte ikke ut addresse. » Tilbake til skjemaet"); } if (empty($postnummer)){ echo("Du fylte ikke ut postnummer. » Tilbake til skjemaet"); } if (empty($sted)){ echo("Du fylte ikke ut sted. » Tilbake til skjemaet"); } if (empty($epost)){ echo("Du fylte ikke ut e-post. » Tilbake til skjemaet"); } include("foot.inc"); } What's wrong here? > T> if ($sted == ""){ > T> include("head.inc"); > T> echo("Du fylte ikke ut sted. > T> » Tilbake til > T> skjemaet"); > 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 telefonnummeret > T> ditt. » class=\"linkdot\">>Tilbake til skjemaet"); > 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 e-postaddressen > T> din. » class=\"linkdot\">>Tilbake til skjemaet"); > 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 kommentarer. > T> » Tilbake til > T> skjemaet"); > T> include("foot.inc"); > T> $Envoi = 0; > T> } > T> else { > T> $MailBody .= "Kommentarer : $kommentarer\n"; > > T> } > > > > -- > Best regards, > Martinmailto:corwin@;corwin.sk > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: .inc files doubles up
"Martin Hudec" <[EMAIL PROTECTED]> wrote in message news:18910327021.20021029184135@;corwin.sk... > Hello Tine, > > it looks okay to me butlooks 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 sted. > T> » Tilbake til > T> skjemaet"); > 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 telefonnummeret > T> ditt. » class=\"linkdot\">>Tilbake til skjemaet"); > 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 e-postaddressen > T> din. » class=\"linkdot\">>Tilbake til skjemaet"); > 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 kommentarer. > T> » Tilbake til > T> skjemaet"); > T> include("foot.inc"); > T> $Envoi = 0; > T> } > T> else { > T> $MailBody .= "Kommentarer : $kommentarer\n"; > > T> } > > > > -- > Best regards, > Martinmailto:corwin@;corwin.sk > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: .inc files doubles up
"Tine" <[EMAIL PROTECTED]> wrote in message news:20021029171957.30722.qmail@;pb1.pair.com... > This is really my first major PHP encounter, and I have attempted to modify > a php form mail script to include a foot.inc and head.inc file, which works > fine if all required fields in the form is filled out. But if there are more > than 2 required fields missing I end up with what you see here: > > http://komposlo.inmono.net/sendform.php > > Now I can understand why that is, but how do I write a command that includes > the head/foot.inc file on certain conditions, so it isn't multiplied like > seen at the above mentioned site? > > > Again, all help is appreciated Should have posted parts of the code to, so you see what I mean ;o) : } if ($sted == ""){ include("head.inc"); echo("Du fylte ikke ut sted. » Tilbake til skjemaet"); include("foot.inc"); $Envoi = 0; } else { $MailBody .= "Sted : $sted\n"; } if ($telefon == "0"){ include("head.inc"); echo("Du fylte ikke ut telefonnummeret ditt. » Tilbake til skjemaet"); include("foot.inc"); $Envoi = 0; } else { $MailBody .= "Telefon : $telefon\n"; } if ($epost == ""){ include("head.inc"); echo("Du fylte ikke ut e-postaddressen din. » Tilbake til skjemaet"); include("foot.inc"); $Envoi = 0; } else { $MailBody .= "E-post : $epost\n"; } if ($kommentarer == ""){ include("head.inc"); echo("Du fylte ikke ut kommentarer. » Tilbake til skjemaet"); include("foot.inc"); $Envoi = 0; } else { $MailBody .= "Kommentarer : $kommentarer\n"; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] .inc files doubles up
This is really my first major PHP encounter, and I have attempted to modify a php form mail script to include a foot.inc and head.inc file, which works fine if all required fields in the form is filled out. But if there are more than 2 required fields missing I end up with what you see here: http://komposlo.inmono.net/sendform.php Now I can understand why that is, but how do I write a command that includes the head/foot.inc file on certain conditions, so it isn't multiplied like seen at the above mentioned site? Again, all help is appreciated -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php form mail - checkbox problem
> Please don't answer with "Tried that" without showing us your new HTML and code > Show us the new code. Sorry - found my mistake. I had forgotten to include a hidden input field :oO -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php form mail - checkbox problem
"Rick Emery" <[EMAIL PROTECTED]> wrote in message news:03f901c27f5a$2bab0e50$0500a8c0@;honeybee... > What is $medlemskap[]??? ? I just modified it from the default code: //Routine for checkboxes $MailBody .="Question 8 : "; $items = 3; //initiate possible # of items for ($i = 1; $i <= $items; $i++) { //loop on # of items $MailBody .= "$champ8[$i], "; //put results in variable MailBody } --- > You MUST refer to item_1[]. > Also, I believe you REALLY meant that all values be accessed through an array; therefore > the "name=" parameter in your HTML must all be the SAME name: > > > hovedmedlemskap [200 kr.] > > 2 eller flere i samme husholdning [100 kr.] Tried that, same same. Still not working :oO > - Original Message - > From: "Tine" <[EMAIL PROTECTED]> > To: <> > Sent: Tuesday, October 29, 2002 8:34 AM > Subject: [PHP] php form mail - checkbox problem > > > Greetings, > > Forgive my newbism here, but I am having a hard time recieving check(box)ed > items from a form sent to e-mail using PHP. > > The code is as follows: > > //Routine for checkboxes > > $MailBody .="Type medlemskap : "; > > $items = 2; //initiate possible # of items > > for ($i = 1; $i <= $items; $i++) { //loop on # of items > > $MailBody .= "$medlemskap[$i], "; //put results in variable MailBody > } > > ..and the html code put in the form is: > > > hovedmedlemskap [200 kr.] > > 2 eller flere i samme husholdning [100 kr.] > > The problem is, when I recieve the form as email, it just shows the checked > item(s) as: ",," > (without the quotemarks) > > What am I doing wrong? I am using the script found here: > http://www.grenadine.net/php/NadForm/NadForm_en.html > > Website where my form is located is here: > http://komposlo.inmono.net/m_skap.html > > Help is very much appreciated! > > Thanks in advance, > Tine > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php form mail - checkbox problem
Greetings, Forgive my newbism here, but I am having a hard time recieving check(box)ed items from a form sent to e-mail using PHP. The code is as follows: //Routine for checkboxes $MailBody .="Type medlemskap : "; $items = 2; //initiate possible # of items for ($i = 1; $i <= $items; $i++) { //loop on # of items $MailBody .= "$medlemskap[$i], "; //put results in variable MailBody } ..and the html code put in the form is: hovedmedlemskap [200 kr.] 2 eller flere i samme husholdning [100 kr.] The problem is, when I recieve the form as email, it just shows the checked item(s) as: ",," (without the quotemarks) What am I doing wrong? I am using the script found here: http://www.grenadine.net/php/NadForm/NadForm_en.html Website where my form is located is here: http://komposlo.inmono.net/m_skap.html Help is very much appreciated! Thanks in advance, Tine -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php