format_number avec htmlspecialchars

format_number avec htmlspecialchars - PHP - Programmation

Marsh Posté le 18-12-2008 à 11:01:06    

Voici mon problème :
Je suis en train de créer un panier virtuel pour un E.commerce avec une partie des codes trouvés dans un script téléchargé sur le net que je tente de personnaliser. Et là, je suis concé  
Je n'arrive pas à formater l'affichage de mon prix article sur la ligne --> echo "<td width=\"53\" align=\"right\">".htmlspecialchars($_SESSION['panier']['prixProduit'][$i])."</td>"; <--
 
J'ai lu qu'il fallait insérer un format_number mais je ne sais pas comment ni où le placer,
merci de votre aide. Voici le script :
<?php
if (creationPanier())
{
$nbArticles=count($_SESSION['panier']['libelleProduit']);
if ($nbArticles <= 0)
echo "<tr height=\"50\"><td colspan=\"6\" align=center class=Style13 >Votre panier est vide ... </td></tr><tr height=\"30\"><td colspan=\"6\"> </td>";
else
{
for ($i=0 ;$i < $nbArticles ; $i++)
{
echo "<table width=\"800\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=Style10>";
echo "<tr>";
echo "<td width=\"243\"></td>";
echo "<td width=\"120\" valign=top class=Style\"14\">".htmlspecialchars($_SESSION['panier']['libelleFamille'][$i])."</ td>";      
echo "<td width=\"305\" valign=top>".htmlspecialchars($_SESSION['panier']['libelleProduit'][$i])."</ td>";
echo "<td width=\"36\" align=\"center\"><input type=\"text\" size=\"1\" background-color=#B6370C name=\"QteArticle[]\" value=\"".htmlspecialchars($_SESSION['panier']['qteProduit'][$i])."\" onChange=\"Submit\"/></td>";
echo "<td width=\"53\" align=\"right\">".htmlspecialchars($_SESSION['panier']['prixProduit'][$i])."</td>";  
echo "<td width=\"43\"align=\"center\"><a href=\"".htmlspecialchars("panier.php?action=suppression&l=".rawurlencode($_SESSION['panier']['libelleProduit'][$i]))."\"><img src=\"panier/supr.jpg\"></a></td>";
echo "</tr>";
echo "</table>";
}
}
echo "<table width=\"800\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"Style10\">";
echo "<tr>";
echo "<td colspan=\"4\" align=\"right\" class=\"Style11\" >______________________________________________________________</td>";
echo "</tr>";  
echo "<tr>";
echo "<td>&nbsp;</td>";
echo "</tr>";  
echo "<tr>";  
echo "<td width=\"298\">&nbsp;</td>";  
echo "<td width=\"274\" align=\"right\"><input type=image src=\"panier/recalcul.jpg\" onChange=\"Submit\" /></td>";  
echo "<td width=\"150\" align=\"right\">Montant total : </td>";
echo "<td width=\"118\" align=\"center\">".MontantGlobal();
echo " EUR";
echo "</td>";  
echo "<input type=\"hidden\" name=\"action\" value=\"refresh\"/>";
echo "</tr>";
echo "</table>";
echo "<table width=\"800\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"Style10\">";
echo "<tr>";
echo "<td width=\"243\" ></td>";
echo "<td colspan=\"5\" align=\"left\" class=\"Style11\"> ______________________________________________________________ </td>";
echo "</tr>";
echo "</table>";
}
?>

Reply

Marsh Posté le 18-12-2008 à 11:01:06   

Reply

Marsh Posté le 18-12-2008 à 14:00:19    

c'est sprintf() pour formater des nombres

Reply

Marsh Posté le 18-12-2008 à 14:18:10    


 
Merci pour ta réponse si rapide.... mais je la rentre à quel endroit cette fonction ?  :??:  :??:  
 
Merci d'avance

Reply

Marsh Posté le 18-12-2008 à 14:27:58    

saintcap a écrit :


 
Merci pour ta réponse si rapide.... mais je la rentre à quel endroit cette fonction ?  :??:  :??:  
 
Merci d'avance


À l'endroit où la lumière du soleil ne parvient pas.


---------------
Stick a parrot in a Call of Duty lobby, and you're gonna get a racist parrot. — Cody
Reply

Marsh Posté le 18-12-2008 à 14:44:29    

masklinn a écrit :


À l'endroit où la lumière du soleil ne parvient pas.


 [:punisher160]  :p

Reply

Marsh Posté le 18-12-2008 à 15:31:38    


 
YES !  :bounce:  

Reply

Marsh Posté le 18-12-2008 à 15:43:41    

Ha mais [:punisher160] pour toi aussi vu ton manque d'implication. ( [:sh@rdar] c'est la base :pfff: )

Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed