| Autor | Zpráva | ||
|---|---|---|---|
| pito Profil |
#1 · Zasláno: 27. 4. 2008, 11:27:04
mam problem ve vypisu.Kdyz si tipnu treba na 1 tak mi to odesle a zapise ale kdyz kliknu na druhy zapas treba na 2 tak mi ta 1 smaze jak udelat aby se nesmazala. viz si muzete vyskouset na mojich strankach http://www.icq5pool.wz.cz/index.php
|
||
| pito Profil |
#2 · Zasláno: 27. 4. 2008, 11:27:39
tady je zapis:
<style type="text/css"> input#odeslat {background-color: white; color: black; border: none; text-decoration: underline;} input#odeslat:hover {color: red; text-decoration: none;} </style> <form action="index.php" method="POST"> <table width="200"> <tr> <td><input type"text" name="zapas" value="Arsenal - Sparta" size="20"></td> <td><input type="submit" name="vek" value="1" id="odeslat"></td> <td><input type="submit" name="vek" value="0" id="odeslat"></td> <td><input type="submit" name="vek" value="2" id="odeslat"></td> </tr> <tr> <td><input type"text" name="zapas2" value="Juventus - Chelsea" size="20"></td> <td><input type="submit" name="vek2" value="1" id="odeslat"></td> <td><input type="submit" name="vek2" value="0" id="odeslat"></td> <td><input type="submit" name="vek2" value="2" id="odeslat"></td> </tr></table> </form> <br><br><br><br> <center><b>Můj tiket</b></center> <style> .styl2 { border: 1px solid black; padding: 2px; } .styl1 { border: 1px solid black; background-color: #333333; padding: 2px; } </style> <? echo "<table border='0' width='150'>"; echo "<tr bgcolor='#333333'> <td align='center'><font color='white'>Zápas</td> <td align='center'><font color='white'>Tip</td> </tr>"; echo "<tr bgcolor='#333333'> <td><font color='white'>$zapas</td> <td align='center'><font color='white'>$vek</td> </tr>"; echo "<tr bgcolor='#333333'> <td><font color='white'>$zapas2</td> <td align='center'><font color='white'>$vek2</td> </tr>"; echo "</table>"; ?> |
||
| Adam Zábranský Profil |
#3 · Zasláno: 27. 4. 2008, 11:50:29 · Upravil/a: Adam Zábranský
pito
jestli to dobře chápu, tak ty odešleš metodou přes POST vek2 nebo vek a ten pak zobrazíš na stránce. No problém bude asi v tom, že když formulář podruhé odešleš, date POST z prvního odeslání už neodešleš, takže se zobrazit nemůžou. |
||
| pito Profil |
#4 · Zasláno: 27. 4. 2008, 11:51:55
takze tam ma byt GET
|
||
| pito Profil |
#5 · Zasláno: 27. 4. 2008, 11:53:54
to nejde i kdyz tam je GET
|
||
| Matty Profil |
#6 · Zasláno: 27. 4. 2008, 12:06:08
pito
takze tam ma byt GET Kdo ti říkal, že tam máš dát GET? S GET získáváš proměnné z adresy. Adam Zábranský tím chtěl asi říct, že musíš poslat jak vek, tak vek2 najednou. |
||
| pito Profil |
#7 · Zasláno: 27. 4. 2008, 12:20:00 · Upravil/a: pito
tím chtěl asi říct, že musíš poslat jak vek, tak vek2 najednou.
jo chci ale to asi nepujde co?To bych musel mit treba <input type="radio" name="tip" value="1"> |
||
| Adam Zábranský Profil |
#8 · Zasláno: 27. 4. 2008, 12:42:33 · Upravil/a: Adam Zábranský
pito
můžeš udělat třeba toto (napíšu kousek kódu, doufám že to pochopíš): <table width="200">
<tr>
<td><input type"text" name="zapas" value="Arsenal - Sparta" size="20"></td>
if($_POST['vek']) {
echo "<input type='hidden' name='vek' value='".$_POST['vek']."'>";
}
<td><input type="submit" name="vek" value="1" id="odeslat"></td>
<td><input type="submit" name="vek" value="0" id="odeslat"></td>
<td><input type="submit" name="vek" value="2" id="odeslat"></td>
</tr>
<tr>
<td><input type"text" name="zapas2" value="Juventus - Chelsea" size="20"></td>
if($_POST['vek2']) {
echo "<input type='hidden' name='vek' value='".$_POST['vek2']."'>";
}
<td><input type="submit" name="vek2" value="1" id="odeslat"></td>
<td><input type="submit" name="vek2" value="0" id="odeslat"></td>
<td><input type="submit" name="vek2" value="2" id="odeslat"></td>
</tr></table>
</form> |
||
| pito Profil |
#9 · Zasláno: 27. 4. 2008, 13:17:08
nejede to
|
||
| Adam Zábranský Profil |
#10 · Zasláno: 27. 4. 2008, 13:44:47 · Upravil/a: Adam Zábranský
jo promiň, spíš takhle:
<table width="200">
<tr>
<td><input type"text" name="zapas" value="Arsenal - Sparta" size="20"></td>
if($_POST['vek2']) {
echo "<input type='hidden' name='vek2' value=\"".$_POST['vek2']."\">";
}
<td><input type="submit" name="vek" value="1" id="odeslat"></td>
<td><input type="submit" name="vek" value="0" id="odeslat"></td>
<td><input type="submit" name="vek" value="2" id="odeslat"></td>
</tr>
<tr>
<td><input type"text" name="zapas2" value="Juventus - Chelsea" size="20"></td>
if($_POST['vek']) {
echo "<input type='hidden' name='vek' value=\"".$_POST['vek']."\">";
}
<td><input type="submit" name="vek2" value="1" id="odeslat"></td>
<td><input type="submit" name="vek2" value="0" id="odeslat"></td>
<td><input type="submit" name="vek2" value="2" id="odeslat"></td>
</tr></table>mimochodem "nejede to" je odpověd dost nanic. |
||
|
Časová prodleva: 18 let
|
|||
0