I've stack in a part where I need to define the requirements to send email.
I have fields in my form like this:
<span class="parts"><input type="text" name="amount1" value="0" class="amount_parts" /></span> <span class="parts"><input type="text" name="amount2" value="0" class="amount_parts" /></span> <span class="parts"><input type="text" name="amount3" value="0" class="amount_parts" /></span> <span class="parts"><input type="text" name="amount4" value="0" class="amount_parts" /></span> <span class="parts"><input type="text" name="amount5" value="0" class="amount_parts" /></span> <span class="parts"><input type="text" name="amount6" value="0" class="amount_parts" /></span>
I would define, when this input field have a value of 0, that this value is not sent with the mail function.
A part of my mail.php:
$message ="Part1 - " . $_POST["amount1"] . " parts/a\r\nPart2 - ". $_POST["amount2"] . " parts/a\r\nPart3 - " . $_POST["amount3"] . " parts/a\r\nPart4 - " . $_POST["amount4] . " parts/a\r\nPart5 - " . $_POST["amount5"] . "parts/a\r\n\nPart6:\r\n" . $_POST["amount6"]; .....
So, if a user fill the 3th, 4th 5th field with some number that are not 0, and leaves the 1st, 2nd and 6th field with the default value (value of 0), I would like that the mail function send only fields with numbers that are not 0.
Thx in advance! :)


Sign In
Create Account

Back to top









