[php] pourquoi ca marche pas ca

Résolu/Fermé
antic80 Messages postés 4751 Date d'inscription lundi 30 mai 2005 Statut Contributeur Dernière intervention 9 septembre 2009 - 3 mai 2006 à 14:03
antic80 Messages postés 4751 Date d'inscription lundi 30 mai 2005 Statut Contributeur Dernière intervention 9 septembre 2009 - 3 mai 2006 à 16:27
bonjour

voila pkoi ce code ne marche pas

print'      <td class="indice" width="450px" height="50px">';
if ($NumEssai==1){
<div style="display: block;" id="indice1"><img border="0" src="../../../Image/indice1.jpg"></div>
}
if ($NumEssai==2){
<div style="display: block;" id="indice2"><img border="0" src="../../../Image/indice2.jpg"></div>
}
if ($NumEssai==3){
<div style="display: block;" id="indice3"><img border="0" src="../../../Image/indice3.jpg"></div>
}

print '</td>';
A voir également:

11 réponses

Fada09 Messages postés 1701 Date d'inscription lundi 15 septembre 2003 Statut Contributeur Dernière intervention 4 septembre 2010 539
3 mai 2006 à 15:19
Salut,

Maily voulais te dire :

print'<td class="indice" width="450px" height="50px">

if ($NumEssai==1)
{
print'<div style="display: block;" id="indice1"><img border="0" src="../../../Image/indice1.jpg"></div>';
}

if ($NumEssai==2)
{
print'<div style="display: block;" id="indice2"><img border="0" src="../../../Image/indice2.jpg"></div>';
}

if ($NumEssai==3)
{
print'<div style="display: block;" id="indice3"><img border="0" src="../../../Image/indice3.jpg"></div>';
}

</td>';

1
maily Messages postés 7556 Date d'inscription lundi 26 juin 2000 Statut Contributeur Dernière intervention 23 juin 2023 453
3 mai 2006 à 14:15
Bonjour!

il faut pas mettre print après chaque if et avant <div>?
0
antic80 Messages postés 4751 Date d'inscription lundi 30 mai 2005 Statut Contributeur Dernière intervention 9 septembre 2009 1 159
3 mai 2006 à 14:26
je comprend pas très bien

meme en faisant ca c pareil

print'      <td class="indice" width="450px" height="50px">if ($NumEssai==1){
<div style="display: block;" id="indice1"><img border="0" src="../../../Image/indice1.jpg"></div>
}
if ($NumEssai==2){
<div style="display: block;" id="indice2"><img border="0" src="../../../Image/indice2.jpg"></div>
}
if ($NumEssai==3){
<div style="display: block;" id="indice3"><img border="0" src="../../../Image/indice3.jpg"></div>
}

</td>';
0
antic80 Messages postés 4751 Date d'inscription lundi 30 mai 2005 Statut Contributeur Dernière intervention 9 septembre 2009 1 159
3 mai 2006 à 15:40
ca ne marche pas

en essayant d'afficher ma page je n'ai rien ce qui veux dire qu'il y a une erreur de code dans la page
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
Fada09 Messages postés 1701 Date d'inscription lundi 15 septembre 2003 Statut Contributeur Dernière intervention 4 septembre 2010 539
3 mai 2006 à 15:43
Quand tu fais clic droit / Afficher la source tu as quoi ?
0
antic80 Messages postés 4751 Date d'inscription lundi 30 mai 2005 Statut Contributeur Dernière intervention 9 septembre 2009 1 159
3 mai 2006 à 15:47
j'ai ca

<div style="float: top;">

<table colpadding="0" cellspacing="0" style="height: 70px; width: 100%; background-color: #D4D0C8; border-style: solid; border-width: 1px; border-color: #000000;">


<tr>

<td style="width: 50%; height: 70px; border-width: 0px; background-color: #D4D0C8;">
<div align="center">
<a target="_blank" href="https://www.keoconcept.com/"><img src="http://00keoconcept.keogratuit.com/banniere/banniere.png" border="0"></a> 
</div>
</td>

<td style="width: 50%; border-width: 0px; background-color: #D4D0C8;">
<div align="center">

<script type="text/javascript"><!--
google_ad_client = "pub-9308770625017089";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = "708898";
google_color_bg = "DCE3E9";
google_color_link = "000000";
google_color_url = "666666";
google_color_text = "333333";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
  </script>

</div>
</td>



</tr>

<tr style="background-color: #000000; text-align: center; height: 20px;">
<td style="border-width: 0px; background-color: #000000;">
<div align="center">
<a target="_blank" href="http://00keoconcept.keogratuit.com/joomla/component/option,com_simplefaq/task,dis..."><font color="#ffffff" size="2">Comment faire disparaitre cette publicit&eacute; ?</a></font>
</td>
<td style="text-align: center; border-width: 0px; background-color: #000000;"><font color="#ffffff" size="2">H&eacute;berg&eacute; GRATUITEMENT par <a target="_blank" href="http://www.keohosting.net"><font color="#ffffff">http://www.keohosting.net</font></a></font>
</td>
</tr>



</table>
</div>
<br />

0
kilian Messages postés 8731 Date d'inscription vendredi 19 septembre 2003 Statut Modérateur Dernière intervention 20 août 2016 1 527
3 mai 2006 à 15:47
Pour simplifier:

<td class="indice" width="450px" height="50px">

<div style="display: block;" id="indice<? echo $NumEssai; ?>"><img border="0" src="../../../Image/indice<? echo $NumEssai; ?>.jpg"></div>
0
antic80 Messages postés 4751 Date d'inscription lundi 30 mai 2005 Statut Contributeur Dernière intervention 9 septembre 2009 1 159
3 mai 2006 à 15:51
merci killian mais je souhaite que quand $NumEssai=3 les 3 images soient affichés
0
Fada09 Messages postés 1701 Date d'inscription lundi 15 septembre 2003 Statut Contributeur Dernière intervention 4 septembre 2010 539
3 mai 2006 à 15:57
Ben je sais pas trop comment est ton code php mais même <td class="indice" ne s'affiche pas !

En plus tu as pas de balise <html> ni <head> ni <title> ni <body> qui sont obligatoires sans parler du doctype des attributs obligatoires (alt sur une image, title sur un lien, ...)

Le mieux c'est de copier coller ton code php ici
0
kilian Messages postés 8731 Date d'inscription vendredi 19 septembre 2003 Statut Modérateur Dernière intervention 20 août 2016 1 527
3 mai 2006 à 16:07
Ben sinon, le soucis c'est que les if sont compris dans les guillemets qui encadrent le texte.
Les guillemets ne doivent contenir que du texte, et pas de code php.

<td class="indice" width="450px" height="50px">

<?
if ($NumEssai==1)
{
      print '<div style="display: block;" id="indice1"><img border="0" src="../../../Image/indice1.jpg"></div>';
}

elseif ($NumEssai==2)
{
       print '<div style="display: block;" id="indice2"><img border="0" src="../../../Image/indice2.jpg"></div>';
}

elseif ($NumEssai==3)
{
        print '<div style="display: block;" id="indice3"><img border="0" src="../../../Image/indice3.jpg"></div>';
}
?>

</td>
0
antic80 Messages postés 4751 Date d'inscription lundi 30 mai 2005 Statut Contributeur Dernière intervention 9 septembre 2009 1 159
3 mai 2006 à 16:27
c bon j'ai viré tout les print et echo et ca marche


merci a vous
0