Reply to Re: php condition in a tabel with html and php

Your name:

Reply:


Posted by Jerry Stuckle on 10/09/06 13:17

elia wrote:
> Hello,
>
> I would like to show a line in a tabel in html if there is quantity of
> article choosed.
>
> My code is:
>
> <? if ($quantite1 > 0) {
> echo('
> <tr>
> <td align="left" nowrap="nowrap">Article 1</td>
> <td align="center"><? echo $quantite1 ?> </td>
> <td align="center">20 &euro;</td>
> <td align="center"> <? echo $montant1 ?> &euro;</td>
> </tr>');
> }
> else{
> echo("");
> }
> ?>
>
> If there is no article >> no line
> If there is article >> show the line
>
> Problem: I can have the variable $quantite1 and $montant1 en php
>

Two options:

<? if ($quantite1 > 0) {
echo('
<tr>
<td align="left" nowrap="nowrap">Article 1</td>
<td align="center">' .$ quantite1 . '</td>
<td align="center">20 &euro;</td>
<td align="center">' . $montant1 . ' &euro;</td>
</tr>');
}
else{
echo("");
}
?>

Or

<? if ($quantite1 > 0) {
echo("
<tr>
<td align=\"left\" nowrap=\"nowrap\">Article 1</td>
<td align=\"center\">$quantite1</td>
<td align=\"center\">20 &euro;</td>
<td align=\"center\">$montant1 &euro;</td>
</tr>');
}
else{
echo("");
}
?>

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация