In the middle of an HTML document, I am adding some php code to display
some text only if a variable is set. Here is my code:
<?
$people = $_POST['people'];
$people_fee= $people * 10;
$people_text='< tr bgcolor="#fffff f">
<td valign="top"wid th="25%"><font size="2" color="black"
face="arial">Ex tra people</td>
<td valign="top" width="60%" align="left"><f ont size="2"
color="black" face="arial">An alysis of, or compatibility with, <?
print($people); ?> other person(s) (first person included without
charge)
</td>
<td valign="top" width="15%" align="left"><f ont size="2" color="black"
face="arial"><? print( $people_fee)?>< br>
</td>
</tr>';
if ($people) {
print ($people_text);
}
?>
The above partially works. If $people has anything in it, the HTML
displays the text saying "Extra people," etc. But the value of $people
and $people_fee do not print out. Why is this?
Thank you.
some text only if a variable is set. Here is my code:
<?
$people = $_POST['people'];
$people_fee= $people * 10;
$people_text='< tr bgcolor="#fffff f">
<td valign="top"wid th="25%"><font size="2" color="black"
face="arial">Ex tra people</td>
<td valign="top" width="60%" align="left"><f ont size="2"
color="black" face="arial">An alysis of, or compatibility with, <?
print($people); ?> other person(s) (first person included without
charge)
</td>
<td valign="top" width="15%" align="left"><f ont size="2" color="black"
face="arial"><? print( $people_fee)?>< br>
</td>
</tr>';
if ($people) {
print ($people_text);
}
?>
The above partially works. If $people has anything in it, the HTML
displays the text saying "Extra people," etc. But the value of $people
and $people_fee do not print out. Why is this?
Thank you.
Comment