Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php] Problem z formularzem
Ania-678
post
Post #1





Grupa: Zarejestrowani
Postów: 72
Pomógł: 0
Dołączył: 15.06.2007

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


Witam.

Mam problem z przekazaniem $_POST do mysql_query w tymże formularzu:

  1. <?php
  2. echo "<br />Edycja: <b>".$edit_player['user']."</b> (".$edit_player['id'].")" ;
  3. echo "<form method=POST action=edycja.php?edit=".$_GET['edit']."&e=ed>
  4.  Imię: <input type=text name=name value=".$edit_player['user']."><br />
  5.  <input type=submit name=submit value=Zmień /><br />
  6. </form>";
  7.  if ($_GET['e'] == 'ed')
  8. {
  9.  
  10. $meu45f = $_POST['name'];
  11. echo $meu45f;
  12. mysql_query("UPDATE users SET user='".$meu45f."' WHERE id= ".$edit_player['id']."");
  13. }
  14. ?>


Ten SET='".$meu45f."' się nie chce za nic zrobić i ciągle puste pole wstawia, ale zapytanie działa bo sprawdzałam, wstawiając w SET zwykły tekst i szło, ale z $_POST nie chce i już godzinę nad tym siedzę i przyczyny czemu tak się dzieje znaleźć nie mogę... (IMG:http://forum.php.pl/style_emoticons/default/sadsmiley02.gif)

Ten post edytował Ania-678 7.08.2007, 13:51:14
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
Ania-678
post
Post #2





Grupa: Zarejestrowani
Postów: 72
Pomógł: 0
Dołączył: 15.06.2007

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


ehhh... może zrobię prościej - dam całość bo Ja już głupieję:

  1. <?php
  2.  
  3. require_once("./cfg.php");
  4.  
  5. echo "<br /><center><ul>
  6. <li><a href=edit.php?edit=>Edytuj użytkownika</a>
  7.  
  8. </ul>";
  9.  
  10. if (isset ($_GET['edit']) && $_GET['edit'] == $_GET['edit'])
  11. {
  12. echo "<center><form method=\"get\" action=\"edit.php?edit=".$_GET['edit']."\">
  13. <input type=\"text\" name=\"edit\" />
  14. <br /><br /><input type=\"submit\" value=\"Edytuj\" /></form>";
  15. if (!empty($_GET['edit']))
  16. {
  17. $ch = mysql_fetch_array(mysql_query('SELECT id FROM users WHERE id = '.$_GET['edit'].''));
  18. if (empty($ch['id']))
  19. {
  20. echo "Zły użytkownik!";
  21. }
  22. else
  23. {
  24. $edit_player = mysql_fetch_array(mysql_query('SELECT * FROM users WHERE id = '.$_GET['edit'].''));
  25. }
  26. echo "<br />Edycja: <b>".$edit_player['user']."</b> (".$edit_player['id'].")" ;
  27. echo "<form method=POST action=\"edit.php?edit=".$_GET['edit']."&e=ed\">
  28.  Imię: <input type=text name=name value=".$edit_player['user']."><br />
  29.  <input type=\"submit\" name=\"submit\" value=\"Zmień\" /><br />
  30. </form>";
  31.  if ($_GET['e'] == 'ed')
  32. {
  33. $meu45f = $_POST['name'];
  34.  
  35. echo $meu45f;
  36. mysql_query("UPDATE users SET user='".$meu45f."' WHERE id= ".$edit_player['id']."") or die (mysql_error());
  37. }
  38. }
  39.  
  40. }
  41.  
  42. ?>


Ten post edytował Ania-678 7.08.2007, 14:48:23
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: 6.10.2025 - 17:53