Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Zapis wyboru w polach
LucKy_skiLL
post
Post #1





Grupa: Zarejestrowani
Postów: 84
Pomógł: 0
Dołączył: 4.03.2012

Ostrzeżenie: (0%)
-----


Mam taki kod, który wyświetla trzy napisy (vip, premium, slot) i przy każdym jest wybór 'On' lub 'Off', wszystko zapisuje się w bazie sql, lecz po wysłaniu, wszystko zmienia się na 'On' ale jest np. 'Off' jak zrobić, aby była zaznaczona opcja która została wybrana (trochę haotycznie napisane, ale mam nadzieje, że zrozumiecie.)



  1. <table width='160'>
  2. <tr>
  3. <td width='72'><font size='2'><b>VIP:</b></font></td>
  4. <div align='center'>
  5. <td width='116'><input type='radio' name='vip' value='1' checked='checked' /><font size='2'>On</font><input type='radio' name='vip' value='0' /><font size='2'>Off</font></td></div>
  6. </tr>
  7. <tr>
  8. <td><font size='2'><b>Premium:</b></font></td>
  9. <div align='center'>
  10. <td><input type='radio' name='premium' value='1' checked='checked' /><font size='2'>On</font><input type='radio' name='premium' value='0' /><font size='2'>Off</font></td></div>
  11. </tr>
  12. <tr>
  13. <td height='23' scope='row'><font size='2'><b>Slot:</b></font></td>
  14. <div align='center'>
  15. <td><input type='radio' name='slot' value='1' checked='checked' /><font size='2'>On</font><input type='radio' name='slot' value='0' /><font size='2'>Off</font></td></div>
  16. </tr>
  17. </table>
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
LucKy_skiLL
post
Post #2





Grupa: Zarejestrowani
Postów: 84
Pomógł: 0
Dołączył: 4.03.2012

Ostrzeżenie: (0%)
-----


  1. Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/luckyskill/domains/public_html/id/acp/acc/ustawienia.php on line 74




linia 74


  1. <td width='116'><input type='radio' name='vip' value='1' '. ($_POST['vip'] == 1 ? ' checked='checked'' : '' ) .' /><font size='2'>On</font><input type='radio' name='vip' value='0' /><font size='2'>Off</font></td></div>
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 5.10.2025 - 15:10