I (Extreme Novice) am trying to email a form that is basically a shopping list…
EGGS [ 0 ]
BACON [ 2 ]
SAUSAGES [ 0 ]
I only want the list that contains items so EGGS and SAUSAGES would not be emailed.
I have been playing with isset but not seeming to get it to work from what I gather 0 is still a value and is technically ‘set’ can someone point me in the right direction here please
A Snippit of the code is as follows…
<?php
if($_POST[“fullName”]) {
mail($_POST[“email”], “Customer Order”,
“NAME: “.$_POST[“fullName”].”\r\n”.
“EMAIL: “.$_POST[“email”].”\r\n”.
“TEL: “.$_POST[“contact”].”\r\n”.
“ADDRESS : #”.$_POST[“doornumber”]." - “.$_POST[“postcode”].”\r\n".
“SITE : “.$_POST[“site”].”\r\n”.
“\r\n”.
“====FOOD====\r\n”.
“[”.$_POST[EGGS]."] x EGGS\r\n".
“[”.$_POST[BACON]."] x BACON\r\n".
“[”.$_POST[SAUSAGES]."] x SAUSAGES\r\n".
… and so forth
Im thinking now should the items be something like…
IF $_POST[EGGS] > 0 { "[".$_POST[EGGS]."] x EGGS\r\n".} ELSE { } ... something like this??!!