/    Sign up×
Community /Pin to ProfileBookmark

Help – Including "if" statements into email $message

How do I include and “if” statement into an email $message.

Example

[code=php]
<?php
$order01 = $_POST[“order01”];
$order02 = $_POST[“order02”];
$order03 = $_POST[“order03″];

if ( $order01 > 0 ) {
echo ” amount of $order01 <br />”;
}

if ( $order02 > 0 ) {
echo ” amount of $order02 <br />”;
}

if ( $order03 > 0 ) {
echo ” amount of $order03 <br />”;
}
?>
[/code]

All I’m trying to do is make sure that anyone that orders only receives the information that was selected not unneeded 0’s or extra echo commands that print nothing as in
“amount of 0”, or “amount of “nothing”.

I’m new to this but I thought this would be simple. Including an if state from those above into the $message of an email.

to post a comment
PHP

0Be the first to comment 😎

×

Success!

Help @ghost2012 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...