Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
2623 connectés 

  FORUM HardWare.fr
  Programmation
  PHP

  format_number avec htmlspecialchars

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

format_number avec htmlspecialchars

n°1828890
saintcap
Posté le 18-12-2008 à 11:01:06  profilanswer
 

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>";
}
?>

mood
Publicité
Posté le 18-12-2008 à 11:01:06  profilanswer
 

n°1828970
Profil sup​primé
Posté le 18-12-2008 à 14:00:19  answer
 

c'est sprintf() pour formater des nombres

n°1828979
saintcap
Posté le 18-12-2008 à 14:18:10  profilanswer
 


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

n°1828987
masklinn
í dag viðrar vel til loftárása
Posté le 18-12-2008 à 14:27:58  profilanswer
 

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.


---------------
I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box by throwing away the limits imposed by overbearing genetic regulations? Isn't that a good thing?
n°1828993
omega2
Posté le 18-12-2008 à 14:44:29  profilanswer
 

masklinn a écrit :


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


 [:punisher160]  :p

n°1829058
saintcap
Posté le 18-12-2008 à 15:31:38  profilanswer
 


 
YES !  :bounce:  

n°1829069
omega2
Posté le 18-12-2008 à 15:43:41  profilanswer
 

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


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  PHP

  format_number avec htmlspecialchars

 

Sujets relatifs
WYSIWYG - Enregistrer code HTML - Recuperer format interprétéeProblème sur formatage de csng et format
Création de formatfaire un timestamp en js a partir d'une date format jj/mm/aaaa
Format d'un datetime ?Concatenation de fichiers excel de même format dans une base access
Format Champs OLAP dans ExcelQuel format pour réalisation d'une séquence vidéo?
comment mettre les cellule de mon JTable au format heuregeneration d'un arbre au format XML
Plus de sujets relatifs à : format_number avec htmlspecialchars


Copyright © 1997-2025 Groupe LDLC (Signaler un contenu illicite / Données personnelles)