Klokjis Posted August 9, 2005 Author Report Share Posted August 9, 2005 paldies bubu, robi es taa biju domaajis... vnk var jau noraadiit $parametrs3=3 bet pirmie 2 jau nav veel zinaami... vinji mainiigi :P Link to comment Share on other sites More sharing options...
bubu Posted August 9, 2005 Report Share Posted August 9, 2005 $urlis = array(); foreach($_GET as $key => $value) { $urlis[] = "$key=$value"; } echo implode('&', $urlis) . '&pageid=5'; Link to comment Share on other sites More sharing options...
Klokjis Posted August 10, 2005 Author Report Share Posted August 10, 2005 nu page=... dalaas ok. bet veel 1 jautaajums... negribeejaas speciaali jaunu topic taisiit... kjipa: <? $krasa1 = 'FFE7CF'; $krasa2 = 'FFB66E'; $skaits = 0; $krasa = ($skaits % 2) ? $krasa1 : $krasa2; ... while ($row = mysql_fetch_assoc($result)) { echo "\t\t\t<tr bgcolor='".$krasa."'>"; echo "<td width='30' align='center' class='krtabula'></td>"; echo "<td width='75' class='tabula'> ".$row[$vards]."</td>"; echo "<td width='75' class='tabula'> ".$row[$uzvards]."</td>"; ... echo "</tr>\n"; } $skaits++; ?> kur te ir kljuuda, deelj kuras $krasa2 neiekraasojas, katrs 2. <tr>, bet gan visi...??? Link to comment Share on other sites More sharing options...
bubu Posted August 10, 2005 Report Share Posted August 10, 2005 Izlasi savu kodu pats: <? $krasa1 = 'FFE7CF'; // piešķiram $krasa1 kautkādu konstanti. $krasa2 = 'FFB66E'; // piešķiram $krasa2 kautkādu citu konstanti. $skaits = 0; // piešķiram $skaits vērtibu 0 $krasa = ($skaits % 2) ? $krasa1 : $krasa2; // tā kā $skaits=0, un 0%2=0=false, tad $krasa piešķiram $krasa2 ... while ($row = mysql_fetch_assoc($result)) { // kautko daram ciklā ($krasa nemainās!) echo "\t\t\t<tr bgcolor='".$krasa."'>"; echo "<td width='30' align='center' class='krtabula'></td>"; echo "<td width='75' class='tabula'> ".$row[$vards]."</td>"; echo "<td width='75' class='tabula'> ".$row[$uzvards]."</td>"; ... echo "</tr>\n"; } // cikls beidzās $skaits++; // palielinam $skaits par 1, tātad 0+1=1=$skaits ?> Es piem neredzu vietu, kur $krasa mainīgajam būtu pie katras rindas ciklā jāmainās... Link to comment Share on other sites More sharing options...
Robis Posted August 10, 2005 Report Share Posted August 10, 2005 (edited) <? $krasa1 = 'FFE7CF'; $krasa2 = 'FFB66E'; ... $i = 1; while ($row = mysql_fetch_assoc($result)) { $krasa = ($i % 2) ? $krasa1 : $krasa2; echo "\t\t\t<tr bgcolor='".$krasa."'>"; echo "<td width='30' align='center' class='krtabula'></td>"; echo "<td width='75' class='tabula'> ".$row[$vards]."</td>"; echo "<td width='75' class='tabula'> ".$row[$uzvards]."</td>"; ... echo "</tr>\n"; $i++; } ?> Edited August 10, 2005 by Robis Link to comment Share on other sites More sharing options...
Recommended Posts