Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP][HTML] input
krzychu0808
post
Post #1





Grupa: Zarejestrowani
Postów: 428
Pomógł: 2
Dołączył: 1.04.2007
Skąd: Pogorzelica

Ostrzeżenie: (10%)
X----


mam coś takiego.
  1. <?php
  2. .....
  3. echo "<TD><input type=submit value=Usuń></td><td><input type=submit value=Wyświetl dane></td>";
  4. echo '</tr>';
  5. echo "<input type=hidden name=to_dell value=$row_get[id]>";
  6. .....
  7. ?>

  1. <?php
  2. <input type=submit value=Usuń>
  3. ?>

ma
  1. <?php
  2. <input type=hidden name=to_dell value=$row_get[id]>
  3. ?>

ale
  1. <?php
  2. <input type=submit value=Wyświetl dane></td>
  3. ?>

też ma
  1. <?php
  2. <input type=hidden name=to_dell value=$row_get[id]>
  3. ?>



a jak zrobić aby dla
  1. <?php
  2. <input type=submit value=Wyświetl dane></td>
  3. ?>

było np coś takeigo
  1. <?php
  2. <input type=hidden name=dane value=dane>
  3. ?>


zrobiłem tak
  1. <?php
  2. echo "<TD><input type=submit value=Usuń></td><td><input type=submit value=Wyświetl dane></td>";
  3. echo '</tr>';
  4. echo "<input type=hidden name=to_dell value=$row_get[id]>";
  5. echo "<input type=hidden name=dane value=dane>";
  6. echo '</form>';
  7. ?>


ale nie działa dal usuń i dla wyświetla dane działa
  1. <?php
  2. <input type=hidden name=to_dell value=$row_get[id]>
  3. ?>
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
krzychu0808
post
Post #2





Grupa: Zarejestrowani
Postów: 428
Pomógł: 2
Dołączył: 1.04.2007
Skąd: Pogorzelica

Ostrzeżenie: (10%)
X----


hehe kodu na wczytywanie danych jeszcze nie ma bo nie mam czasu ale kod ogólny to:
  1. <?
  2. function authenticate()
  3. {
  4. Header("WWW-authenticate: basic realm=\"Panel Statystyk\"");
  5. Header("HTTP/1.0 401 Unauthorized");
  6. echo '<h1 align="center">Login Error !!!</h1>';
  7. }
  8.  
  9.  
  10. if(!$_SERVER['PHP_AUTH_USER'])
  11. {
  12. authenticate();
  13. }
  14. elseif(($_SERVER['PHP_AUTH_USER'] != "xxx" || $_SERVER['PHP_AUTH_PW'] != "xxx"))
  15. {
  16. authenticate();
  17. }
  18. ?>
  19. <html><head><title>Panel admina</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2"></head><body>
  20.  
  21. <?
  22.  
  23. $connection = mysql_connect("xxx", "xxx", "xxx");
  24. $db = mysql_select_db("xxx", $connection);
  25.  
  26. # - usuwnaie ogloszenia
  27. if($_POST[to_dell]){
  28. $sql_dell = "delete from dane where id='$_POST[to_dell]'";
  29. mysql_query($sql_dell);
  30. }
  31.  
  32. # - dodawanie ogloszenia
  33. $dat_r = date("d-m-Y");
  34. if($_POST[login] && $_POST[tresc]){
  35. $sql_add = "insert into dane(data, login, tresc, dataur) values('$dat_r', '$login', '$tresc', '$dataur')";
  36. $dodane = mysql_query($sql_add);
  37. }
  38.  
  39. $sql_get = "select * from dane order by id";
  40. $dane_get = mysql_query($sql_get);
  41. if(mysql_num_rows($dane_get)>0){
  42.  
  43. echo '<table border="1" WIDTH="80%">';
  44.  echo '<TH width="10%">Nr</TH><TH width="15%">Data Dodania</TH><TH width="35%">Login</TH><TH width="35%">Imię i Nazwisko</TH><TH width="35%">Data Urodzin</TH><TH width="10%">Usuń</TH><TH width="10%">Wyświetl</TH>';
  45. while($row_get=mysql_fetch_array($dane_get)){
  46. echo '<form method="post" action="james.php">';
  47. echo '<TR>';
  48. echo "<TD ><center>$row_get[id]</center></TD><TD><center>$row_get[data]</center></td><TD><center>$row_get[login]</center></tD><TD><center>$row_get[tresc]</center></td><TD><center>$row_get[dataur]</center></tD>";
  49. echo "<TD><input type=submit value=Usuń></td><td><input type=submit value=Wyświetl dane></td>";
  50. echo '</tr>';
  51. echo "<input type=hidden name=to_dell value=$row_get[id]>";
  52. echo '</form>';
  53. }
  54. echo '</table>';
  55. }
  56. else echo '<b>brak danych</b>';
  57. echo '<BR><BR>';
  58. echo '<B>DODAJ NOWEGO UŻTKOWNIKA</B>';
  59. if($dodane) echo '<h1>Dodano Użytkownika</h1>';
  60. echo '<form method="post" action="james.php">';
  61. echo '<B>Login:</b><BR><input type="text" name="login">';
  62. echo '<BR><B>Imię i Nazwisko</b><BR>';
  63. echo '<input type="text" name="tresc"><br/>';
  64. echo '<B>Data Urodzenia</b><BR>';
  65. echo '<input type="text" name="dataur"><br/>';
  66. echo '<input type="submit" value="Dodaj">';
  67. echo '</form>';
  68. ?></body></html>
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: 26.09.2025 - 08:48