If Elseif Else Help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
maxline
Forum Newbie
Posts: 7
Joined: Thu Apr 29, 2010 10:14 pm

If Elseif Else Help

Post by maxline »

What am I doing wrong with this if elseif else statement? I am needing 1 of 3 things to happen
either give an input box if the default value of 0.00 is in place, echo a value previously entered value if not = to "Unused" or just keep the value as "Unused" if it already is such.

Code: Select all

<?php
$secret = Unused; $holder = 0.00;
if ($holder == $amount1) { ?>
<td>$&nbsp; <input type="text"name="amount1" value="" maxlength="12" onkeypress="return noenter()"</td>
<?php }elseif ($date1 != $secret)
{
echo '<td align="center">$' .$amount1. '</td>'; 
}else{ 
} ?>  
<input type="hidden"name="amount1" value="Unused" maxlength="12" onkeypress="return noenter()">

User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: If Elseif Else Help

Post by Christopher »

You have the last input outside the else. What part is not working?
(#10850)
Post Reply