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

  FORUM HardWare.fr
  Programmation
  PHP

  erreur Affichage tableau [firefox et explorer]

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

erreur Affichage tableau [firefox et explorer]

n°1997291
eek
Posté le 30-05-2010 à 19:18:37  profilanswer
 

Bonjour,
J'ai un petit souci d'affichage entre firefox et explorer.
 
ma page php s'affiche correctement sous explorer
 
http://img180.imageshack.us/img180/6180/76438066.jpg
 
 
mais sous firefox, sa bug un peu.
 
http://img684.imageshack.us/img684/2196/firefoxxf.jpg
 
d'où peu provenir se problème ?

mood
Publicité
Posté le 30-05-2010 à 19:18:37  profilanswer
 

n°1997725
SICKofitAL​L
misanthrope
Posté le 31-05-2010 à 22:28:42  profilanswer
 

Le problème vient clairement de ton code (si ca marche sous IE et pas sous FF, ya 99% de chance que le soucis viennet d'un code moisi :D), mais qui brille par son absence...
Et comme BouleDeCrystal v1.0 ne fonctionne plus :o


---------------
We deserve everything that's coming...
n°1997726
eek
Posté le 31-05-2010 à 22:29:43  profilanswer
 

voila le code..
 
<?
 
 
require("admin/config.php" );
 
 
?>
 
 
 
 
 
<html>
 
 
<head><title><? echo $myclan ?> - <? echo $title ?></title>
 
 
<? echo $style ?>
 
 
</head>
 
 
<body bgcolor="<? echo $bodycolor ?>" text="<? echo $bodytext ?>">
 
 
<p>
 
 
<p>
 
 
<center><font size=4>MATCHS</font></center></p><center>
 
 
<p>
 
 
</center><div align=center>
 
 
<table border=1 bordercolor='<? echo $bodycolor ?>' cellpadding=0 cellspacing=0 width=200>
 
 
<center>
 
 
<tr bgcolor='<? echo $toptable ?>'>
 
 
<td align=center width='10%'><font color="#FFFFFF">Clan</font></td>
 
 
<td align=center width='10%'><font color="#FFFFFF">Date</font></td>
 
 
<td align=center width='5%'><font color="#FFFFFF">Country</font></td>
 
 
<td align=center width='5%'><font color="#FFFFFF">Results</font></td>
 
 
<td align=center width='7%'><font color="#FFFFFF">Scores</font></td>
 
 
<td align=center width='5%'><font color="#FFFFFF">Cap.Av.</font></td>
 
 
<td align=center width='15%'><font color="#FFFFFF">Maps</font></td>
 
 
<td align=center width='10%'><font color="#FFFFFF">League</font></td>
 
 
<td align=center width='5%'><font color="#FFFFFF">Report</font></td>
 
 
</tr>
 
 
<?
 
 
$db = mysql_connect("$host", "$login", "$passwd" ) or Die("Base Down !" );
 
 
mysql_select_db("$base",$db) or Die("Base Down !" );
 
 
 
 
 
$req = mysql_query("SELECT * FROM matchs_tbl ORDER BY date DESC" );
 
 
$res = mysql_numrows($req);
 
 
 
 
 
$i=0;
 
 
WHILE($res!=$i)
 
 
{
 
 
$id = mysql_result($req,$i,"id" );
 
 
$clan = mysql_result($req,$i,"clan" );
 
 
$flag = mysql_result($req,$i,"flag" );
 
 
$url = mysql_result($req,$i,"url" );
 
 
$map1 = mysql_result($req,$i,"map1" );
 
 
$map2 = mysql_result($req,$i,"map2" );
 
 
$score1us = mysql_result($req,$i,"score1us" );
 
 
$score2us = mysql_result($req,$i,"score2us" );
 
 
$score1them = mysql_result($req,$i,"score1them" );
 
 
$score2them = mysql_result($req,$i,"score2them" );
 
 
$scoreustotal = ($score1us + $score2us);
 
 
$scorethemtotal = ($score1them + $score2them);
 
 
$victory = mysql_result($req,$i,"victory" );
 
 
$league = mysql_result($req,$i,"league" );
 
 
$goalaverage = ($score1us + $score2us - $score1them - $score2them);
 
 
$victory = str_replace("oui","<font color=green>Win</font></a>", $victory);
 
 
$victory = str_replace("non","<font color=red>Lost</font></a>", $victory);
 
 
$victory = str_replace("nul","<font color=white>Draw</a></font>", $victory);
 
 
$report = mysql_result($req,$i,"report" );
 
 
if($goalaverage<"0" ){ $goalaverage = "$goalaverage <img src='images/negatif.gif'>"; }
 
 
if($goalaverage>"0" ){ $goalaverage = "+$goalaverage <img src='images/positif.gif'>"; }
 
 
if($goalaverage=="0" ){ $goalaverage = "0 <img src='images/null.gif'>"; }
 
 
if($report=="" ){ $report = "<img src='images/report2.gif'>"; }
 
 
if($report=="oui" ){ $report = "<A title='Voir le Rapport du Match contre les $clan' href=matchs_report.php3?id=$id><img src=images/report.gif border=0></a>"; }
 
 
$date = mysql_result($req,$i,"date" );
 
 
$date_vf = ereg_replace('^([0-9]{2,4})-([0-9]{1,2})-([0-9]{1,2})$','\\3/\\2/\\1', $date);
 
 
$g = mysql_query("SELECT * FROM matchs_tbl WHERE victory='oui'" );
 
 
$p = mysql_query("SELECT * FROM matchs_tbl WHERE victory='non'" );
 
 
$n = mysql_query("SELECT * FROM matchs_tbl WHERE victory='nul'" );
 
 
$winn = mysql_numrows($g);
 
 
$lostt = mysql_numrows($p);
 
 
$draww = mysql_numrows($n);
 
 
$playy = ($winn + $lostt + $draww);
 
 
$pourcentagewinn = ($winn / $playy * 100);
 
 
$pourcentagelostt = ($lostt / $playy * 100);
 
 
$pourcentagedraww = ($draww / $playy * 100);
 
 
if(strlen($pourcentagewinn)>4){ $pourcentagewinn = substr($pourcentagewinn,0,4).""; }else{ $pourcentagewinn = "$pourcentagewinn"; }
 
 
if(strlen($pourcentagelostt)>4){ $pourcentagelostt = substr($pourcentagelostt,0,4).""; }else{ $pourcentagelostt = "$pourcentagelostt"; }
 
 
if(strlen($pourcentagedraww)>4){ $pourcentagedraww = substr($pourcentagedraww,0,4).""; }else{ $pourcentagedraww = "$pourcentagedraww"; }
 
 
 
 
 
// array
 
 
$table = array(
 
 
"D_ROWS" => "<tr bgcolor='$bodytable'>",
 
 
"D_COLS" => "<td align=center width='10%'>",
 
 
"D_COLS2" => "<td align=center width='15%'>",
 
 
"D_COLS3" => "<td align=center width='5%'>",
 
 
"D_COLS4" => "<td align=center width='7%'>",
 
 
"F_COLS" => "</tr>",
 
 
"F_ROWS" => "</td>",
 
 
);
 
 
$align = array(
 
 
"F_CENTER" => "</div>",
 
 
"D_RIGHT" => "<div align=right>",
 
 
"F_RIGHT" => "</div>"
 
 
);
 
 
// fin array debut tableau
 
 
echo "$table[D_ROWS]";
 
 
echo "$table[D_COLS2]";
 
 
 
 
 
echo "<a title='Visiter le site des $clan' href=$url target=_blank>$clan</a>";
 
 
echo "$table[F_COLS]";
 
 
 
 
 
echo "$table[D_COLS]";
 
 
echo "$date_vf";
 
 
echo "$table[F_COLS]";
 
 
 
 
 
echo "$table[D_COLS3]";
 
 
echo "<img src='images/$flag.gif'>";
 
 
echo "$table[F_COLS]";
 
 
 
 
 
echo "$table[D_COLS4]";
 
 
echo "$victory";
 
 
echo "$table[F_COLS]";
 
 
 
 
 
echo "$table[D_COLS4]";
 
 
echo "$scoreustotal/$scorethemtotal";
 
 
echo "$table[F_COLS]";
 
 
 
 
 
echo "$table[D_COLS4]";
 
 
echo "$goalaverage";
 
 
echo "$table[F_COLS]";
 
 
 
 
 
echo "$table[D_COLS2]";
 
 
echo "<table width=120 height=1% cols=2><tr height=1><td align=center height=1 width=50%><font size=2><a href=#>$map1</a></font></td><td align=center height=1><font size=2><a href=#>$map2</a></font></td></tr><tr height=1><td align=center height=1><font size=1>( $score1us/$score1them )</font></td><td align=center height=1><font size=1>( $score2us/$score2them )</font></td></tr></table>";
 
 
 
 
 
echo "$table[D_COLS]";
 
 
echo "$league";
 
 
echo "$table[F_COLS]";
 
 
 
 
 
echo "$table[D_COLS3]";
 
 
echo "$report";
 
 
 
 
 
echo "$table[F_COLS]";
 
 
echo "$table[F_COLS]";
 
 
echo "$table[F_ROWS]";
 
 
echo "$table[D_ROWS]";
 
 
 
 
 
echo "$table[F_COLS]";
 
 
 
 
 
// fin tableau
 
 
$i++;
 
 
}
 
 
mysql_close();
 
 
?>
 
 
<tr>
 
 
<td colspan=9>
 
 
<center>
 
 
<font size=1>Sur <a title='100%' href=#><B><? echo $playy ?></B></a>
 
 
Matchs Joués, Nous comptabilisons <a title='<? echo $pourcentagewinn ?>%' href=#><B><? echo $winn ?></b></a>
 
 
Victoires, <a title='<? echo $pourcentagelostt ?>%' href=#><b><? echo $lostt ?></b></a>
 
 
Défaites et <a title='<? echo $pourcentagedraww ?>%' href=#><b><? echo $draww ?></b></a>
 
 
Nuls.</font>
 
 
</center>
 
 
</td>
 
 
</tr>
 
 
</center>
 
 
</table>
 
 
<p></p>


Message édité par eek le 31-05-2010 à 22:33:23
n°1997728
SICKofitAL​L
misanthrope
Posté le 31-05-2010 à 22:34:52  profilanswer
 

:pfff:

 

et en essayant un MINIMUM de faire le ménage dans ce code illisible ? et en utilisant la balise [ code] ? ;)

 

[:_edit]
Des tags FONT, des tags imbriqués et j'en passe, t'as fait ca à la main ou via un soft genre DreamWeaver ? :/


Message édité par SICKofitALL le 31-05-2010 à 22:36:20

---------------
We deserve everything that's coming...
n°1997733
eek
Posté le 31-05-2010 à 22:45:34  profilanswer
 

un "pote" ma filé sa, et ma dit démerde toi avec sa.. sa marche sur ie mais pas ff.
mais bon si sa marche pas sur ff sa me sert a rien..

n°1997738
SICKofitAL​L
misanthrope
Posté le 31-05-2010 à 22:57:49  profilanswer
 

Ok alors soyons clair : le code est affreux !
C'est imbriqué de partout, le PHP se mélange avec le HTML et vice-versa, c'est à la limite du maintenable...
 
Je sais pas si tu sais coder, si oui commence par isoler la génération du tableau en lui même, de tel sorte qu'il fonctionne sur IE+FF.
 
Des trucs genre ca "</tr> </center> </table> " ca tient pas debout et ya que IE pour permettre de telle extremité...
 
Puis tu peux regarder du coté du CSS, parce que les balises FONT ca le faisait en 1998, si tu vois ce que je veux dire ;)


---------------
We deserve everything that's coming...
n°1997739
eek
Posté le 31-05-2010 à 23:03:24  profilanswer
 

merci SICKofitALL de tes conseils .
mais bon je ne sais pas du tout coder.
sa a l'air compliqué, je pensé que c'etait plus simple.. bref tant pis pour moi..

n°1997742
SICKofitAL​L
misanthrope
Posté le 31-05-2010 à 23:14:42  profilanswer
 

Ben techniquement ce que tu veux faire c'est pas compliqué à la base : on prend des données d'une base de données et on affiche le tout sous la forme de tableau.
 
Si tu te sens motivé, commence par apprendre un minimum d'HTML, puis de PHP et enfin de mySQL (la base de données). Pour la partie "visuelle", tu peux mater le CSS.
Bonne chance :)


---------------
We deserve everything that's coming...
n°1997867
art_dupond
je suis neuneu... oui oui !!
Posté le 01-06-2010 à 11:25:15  profilanswer
 

je crois que tu dois changer
 

Code :
  1. "F_COLS" => "</tr>",
  2. "F_ROWS" => "</td>",


 
 
en  
 

Code :
  1. "F_COLS" => "</td>",
  2. "F_ROWS" => "</tr>",


---------------
oui oui
n°1998145
eek
Posté le 01-06-2010 à 22:53:46  profilanswer
 

Grand merci art_dupond !!


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

  erreur Affichage tableau [firefox et explorer]

 

Sujets relatifs
Une erreur à la compilation[Debutant] Python + MYSQL Python, erreur syntaxe dans requette MYSQL
[R] Selection dans un tableau.Convertir un tableau Java en JavaScript
[ Plugin firefox ] Faire communiquer firefox avec une appli desktop[ HTML] Tableau
html: Probleme entre getElementById et internet explorer[Résolu] Bug div Firefox
[resolu][PHP] parcourir un tableau d'objetafficher en tableau ou div
Plus de sujets relatifs à : erreur Affichage tableau [firefox et explorer]


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR