You are here: Re: php condition in a tabel with html and php « PHP Programming Language « IT news, forums, messages
Re: php condition in a tabel with html and php

Posted by Peter Fox on 10/09/06 09:44

Following on from elia's message. . .
>Hello,
>
>I would like to show a line in a tabel in html if there is quantity of
>article choosed.
>
>My code is:
broken.


* use _double_ quotes to get $-variables rendered.
* to escape double quotes use \"
* nowrap html syntax!
* print() is same as echo()
* Euro combined with montant
* I've modified your table format to remove redundant and space
consuming bits.


// print column headings before loop
print("<tr><th>Article</th><th>Montant</th></tr>\n");


// inside the loop
if ($quantite1 > 0) { // ignore if no quantity
// tidy up montant for pretty printing
if(!$montant==0){ // assuming $montant is numeric
$m = sprintf('&euro; %6.2f",$montant); // to nice currency string
}else{
$m='';
}
print("<tr>
<td align=\"center\">$quantite1</td>
<td align=\"right\">$m</td>
</tr>");
}


--
PETER FOX Not the same since the e-commerce business came to a .
peterfox@eminent.demon.co.uk.not.this.bit.no.html
2 Tees Close, Witham, Essex.
Gravity beer in Essex <http://www.eminent.demon.co.uk>

 

Navigation:

[Reply to this 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

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