Pomoc - Szukaj - U¿ytkownicy - Kalendarz
Pe³na wersja: Dodaje podwójnie.
Forum PHP.pl > Forum > PHP
Web-Fifi
Mam taki skrypt, w IE 6.0 jest dobrze, dodaje jeden rekord a w Mozilli dodaje 2 - jeden dobry a drugi pusty :/

  1. <table width=470 cellpadding=1 cellspacing=1 bgcolor=black align=right>
  2. <tr bgcolor=#4274A3><td colspan=2><center><b><font size=2>Dodaj Typ</td>
  3.  
  4. <?
  5. if($mod==&#092;"dodaj_typ\" AND $mode==\"\"){
  6. print(&#092;"
  7. <tr bgcolor=#5F90BE><td class=sciagi><b>Wybierz Dyscypline :</td>
  8. <td><SELECT class=mail name=dyscyplina onchange=&#092;"self.location.href = this.value\"> 
  9.  <OPTION VALUE=&#092;"\">Wybierz\");
  10. $dys=mysql_query(&#092;"SELECT * FROM dyscypliny order by 'nazwa_pol'\");
  11. while($dyscyplina=mysql_fetch_row($dys)){
  12. print(&#092;"<option value=\"index.php?mod=dodaj_typ&mode=dodaj&dyscyplina=$dyscyplina[0]\">$dyscyplina[1]\");
  13. }
  14. print(&#092;"</select>\");
  15. }
  16.  
  17. ?>
  18. <?if($mode==&#092;"dodaj\" AND $sub==\"\" AND $dyscyplina!=\"\"){
  19. print(&#092;"<form action=\"index.php?mod=dodaj_typ&mode=dodaj&dyscyplina=$dyscyplina[0]&sub=dodaj_typ\" method=\"post\">\");
  20. echo(&#092;"
  21. <tr bgcolor=#95B8CF><td height=24 width=20%>Dyscyplina<td>\");
  22.  
  23. $ii=mysql_query(&#092;"SELECT * FROM dyscypliny WHERE id='$dyscyplina[0]' order by 'nazwa_pol' \");
  24. while($i=mysql_fetch_row($ii)){
  25. print(&#092;"$i[1]\");
  26. }
  27.  
  28. print(&#092;"
  29.  
  30. <tr bgcolor=#9ABED6><td>Przeciwnik I:</td><td><select name=prz_1 class=ligi><option>Wybierz\");
  31. $ligi = mysql_query(&#092;"select distinct * from ligi WHERE dyscyplina='$dyscyplina' order by 'nazwa_pol'\");
  32. while($lig=mysql_fetch_row($ligi)){
  33. print(&#092;"<option class=ligi>+ $lig[1]\");
  34. $ligi1 = mysql_query(&#092;"select * from druzyny WHERE ligi='$lig[1]' order by 'nazwa_pol'\");
  35. while($lig1 = mysql_fetch_row($ligi1)){
  36. print(&#092;"<option class=mail value=\"$lig1[1]\" name=prz_1>- $lig1[1]\");
  37. }
  38. }
  39.  
  40. print(&#092;"
  41. <tr bgcolor=#9EC3DC><td>Przeciwnik II:</td><td><select name=prz_2 class=ligi><option>Wybierz\");
  42. $ligi2 = mysql_query(&#092;"select distinct * from ligi WHERE dyscyplina='$dyscyplina' order by 'nazwa_pol'\");
  43. while($lig2=mysql_fetch_row($ligi2)){
  44. print(&#092;"<option class=ligi>+ $lig2[1]\");
  45. $lodo = mysql_query(&#092;"select * from druzyny WHERE ligi='$lig2[1]' order by 'nazwa_pol'\");
  46. while($lod = mysql_fetch_row($lodo)){
  47. print(&#092;"<option class=mail value=\"$lod[1]\" name=prz_2>- $lod[1]\");
  48. $lod[2]=$nazwa_kr;
  49. }
  50. }
  51. print(&#092;"
  52.  
  53. </select>
  54.  
  55. <tr bgcolor=#A3C9E3><td>Liga:</td><td><select name=\"liga\" class=ligi><option>Wybierz\");
  56. $ligi = mysql_query(&#092;"select distinct * from ligi WHERE dyscyplina='$dyscyplina' order by 'nazwa_pol'\");
  57. while($lig=mysql_fetch_row($ligi)){
  58. print(&#092;"<option class=mail value=\"$lig[1]\">$lig[1]\");
  59.  
  60. }
  61. print(&#092;"</select>
  62. <tr bgcolor=#A7CFEA><td>Typ:</td><td><select name=typ class=mail><option>Wybierz\");
  63. print(&#092;"
  64. <option value=1>1
  65. <option value=X>X
  66. <option value=2>2
  67. <option value=1X>1X
  68. <option value=X2>X2
  69. <option value=12>12
  70. &#092;");
  71. $data = date('d.m.Y');
  72. $ts = strtotime ('+1 days');
  73. $data1 = date('d.m.Y', $ts);
  74. $ts2 = strtotime ('+2 days');
  75. $data2 = date('d.m.Y', $ts2);
  76. $ts3 = strtotime ('+3 days');
  77. $data3 = date('d.m.Y', $ts3);
  78. $ts4 = strtotime ('+4 days');
  79. $data4 = date('d.m.Y', $ts4);
  80. $ts5 = strtotime ('+5 days');
  81. $data5 = date('d.m.Y', $ts5);
  82. $ts6 = strtotime ('+6 days');
  83. $data6 = date('d.m.Y', $ts6);
  84. echo(&#092;"
  85. <tr bgcolor=#B0DAF7><td>Kurs:</td><td>
  86. <input type=text name=kurs size=class=ligi>
  87.  
  88. <tr bgcolor=#C7E6FB><td>Data:</td><td><select name=data class=ligi><option>Wybierz\");
  89.  
  90. print(&#092;"
  91. <option class=ligi class=mail value=$data>$data
  92. <option class=ligi class=mail value=$data1>$data1
  93. <option class=ligi class=mail value=$data2>$data2
  94. <option class=ligi class=mail value=$data3>$data3
  95. <option class=ligi class=mail value=$data4>$data4
  96. <option class=ligi class=mail value=$data5>$data5
  97. <option class=ligi class=mail value=$data6>$data6
  98. &#092;");
  99. print(&#092;"</select>
  100. <tr bgcolor=#DDF0FD><td>Analiza:</td><td align=left>
  101. <textarea name=analiza cols=25 rows=6></textarea>
  102. <tr bgcolor=#EFF8FF><td colspan=2><center><input type=submit value=\"Dodaj dru¿yne\" name=submit></td></tr>
  103. </form>&#092;");
  104. }
  105.  
  106. ?>
  107. <?if($sub==&#092;"dodaj_typ\" AND $mod==\"dodaj_typ\" AND $mode==\"dodaj\"){
  108. mysql_query(&#092;"INSERT INTO typy VALUES ('','\".$prz_1.\"','\".$prz_2.\"','\".$dyscyplina.\"','\".$liga.\"','\".$typ.\"',
  109. '\".$kurs.\"','\".$analiza.\"','\".$data.\"','-:-','\".$info[0].\"');&#092;") or die(\"B³±d: \".mysql_error());;
  110. ?>
  111. <tr><td bgcolor=95B8CF><center>Dodano <b>TYP</b> do Bazy Danych <a href=index.php?mod=dodaj_typ&mode=dodaj>Dodaj kolejny...</a>
  112. <?}?>
  113.  
  114. </table>


Jak temu zaradziæ ? Mój b³±d czy przegl±darki.
bumfank
nie przegladalem kodu, ale mam podobny problem
zwykly skrypt dodajacy wartosc +1 do licznika kiedy ktos wchodzi na strone, na IE dziala wporzadku na Mozilli dokladniej na FIREFOX dodaje jak chce smile.gif albo 1 albo 2 winksmiley.jpg
To jest wersja lo-fi g³ównej zawarto¶ci. Aby zobaczyæ pe³n± wersjê z wiêksz± zawarto¶ci±, obrazkami i formatowaniem proszê kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.