Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [MYSQL] Zmiana danych
Dizzy
post
Post #1





Grupa: Zarejestrowani
Postów: 139
Pomógł: 0
Dołączył: 6.09.2008

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


  1. <?php
  2. if (!$new_gg)
  3. { echo "BRAK DANYCH!!!";  exit;}
  4. if ($user_pass_new != $user_pass_new2)
  5. { echo "OBA HASŁA NIE SĄ RÓWNE!!!";  exit;}
  6.  
  7. $link = mysql_connect("$db_host","$db_user", "$db_pass") or die ("Nie można nawiązać połączenia.");
  8. mysql_select_db("$db_name");
  9.  $query="update users set
  10. user_mail ='$user_mail_new',
  11. user_gg ='$user_gg_new',
  12. user_pass='$user_pass_new',
  13. where user_login='$username';
  14.  $result= mysql_query($query, $link);
  15.  
  16. echo "DANE ZOSTAŁY ZMIENIONE :)";
  17. ?>

Co w tym jest źle??
Cytat
Parse error: syntax error, unexpected T_STRING in /home/Dizzy/domains/Xxx/public_html/strony/konto.php on line 86

W 86 lini jest:
  1. <?php
  2. echo "DANE ZOSTAŁY ZMIENIONE :)";
  3. ?>


Ten post edytował Dizzy 25.10.2008, 09:01:05
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 10)
Cysiaczek
post
Post #2





Grupa: Moderatorzy
Postów: 4 465
Pomógł: 137
Dołączył: 26.03.2004
Skąd: Gorzów Wlkp.




Co te znaczki robią przed cudzysłowiami \ ?
Wklej ten kod porządnie.
Go to the top of the page
+Quote Post
nevt
post
Post #3





Grupa: Przyjaciele php.pl
Postów: 1 595
Pomógł: 282
Dołączył: 24.09.2007
Skąd: Reda, Pomorskie.

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


popatrz uważnie na tą linijkę:
  1. <?php
  2. $query="update users set
  3. ?>

nie brakuje przypadkiem czegoś?
Go to the top of the page
+Quote Post
Dizzy
post
Post #4





Grupa: Zarejestrowani
Postów: 139
Pomógł: 0
Dołączył: 6.09.2008

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


No niewiem, chyba nie, przecież jest wszystko tzn. co ma zmienić....
Go to the top of the page
+Quote Post
MWL
post
Post #5





Grupa: Zarejestrowani
Postów: 493
Pomógł: 32
Dołączył: 14.04.2008
Skąd: Lenkowski.net

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


wpisz to:
  1. <?php
  2. $query="update users set
  3. user_mail ='$user_mail_new',
  4. user_gg ='$user_gg_new',
  5. user_pass='$user_pass_new',
  6. where user_login='$username'";
  7. $result= mysql_query($query, $link);
  8. ?>

bo to nie może być takie jak zrobiłeś...

Przy okazji pamietaj o filtrowaniu danych bo może być włam (IMG:http://forum.php.pl/style_emoticons/default/tongue.gif)

Ten post edytował MWL 25.10.2008, 09:08:15
Go to the top of the page
+Quote Post
Dizzy
post
Post #6





Grupa: Zarejestrowani
Postów: 139
Pomógł: 0
Dołączył: 6.09.2008

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


Zmieniłem na:
  1. <?php
  2. $query="update users set
  3. user_mail ='$user_mail_new',
  4. user_gg ='$user_gg_new',
  5. user_pass='$user_pass_new',
  6. where user_login='$username'";
  7. $result= mysql_query($query, $link);
  8. ?>


Parse error: syntax error, unexpected '}' in /home/Dizzy/domains/xxx/public_html/strony/konto.php on line 87


:-/

Ten post edytował Dizzy 25.10.2008, 09:12:12
Go to the top of the page
+Quote Post
kallosz
post
Post #7





Grupa: Zarejestrowani
Postów: 272
Pomógł: 19
Dołączył: 29.07.2006

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


wklej cały kod a nie same wycinki
Go to the top of the page
+Quote Post
Dizzy
post
Post #8





Grupa: Zarejestrowani
Postów: 139
Pomógł: 0
Dołączył: 6.09.2008

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


Reszta kodu to formularz w HTML więc jest zbędny...
W tym występuje błąd wiec go dałem...
Go to the top of the page
+Quote Post
pyro
post
Post #9





Grupa: Zarejestrowani
Postów: 2 148
Pomógł: 230
Dołączył: 26.03.2008

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


mimo to daj caly kod
Go to the top of the page
+Quote Post
Dizzy
post
Post #10





Grupa: Zarejestrowani
Postów: 139
Pomógł: 0
Dołączył: 6.09.2008

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


  1. <?php
  2. include 'Konfiguracja/Konfiguracja.php';
  3.  
  4. if ($_SESSION['zalogowany'] == '1') {
  5. echo "<form action='index.php?show=konto' method=post>
  6. <br>
  7. <table border=0 cellspacing=1  id=AutoNumber1>
  8. <tr>
  9. <td  colspan=2>
  10. <p align=center>$username & $user_gg & $user_mail</td>
  11. </tr>
  12. <tr>
  13. <td >&nbsp;</td>
  14. <td >&nbsp;</td>
  15. </tr>
  16. <tr>
  17. <td  colspan=2>&nbsp;</td>
  18. </tr>
  19. <tr>
  20. <td  colspan=2>
  21. <p align=center><b>Ustawienia kontaktowe</b></td>
  22. </tr>
  23. <tr>
  24. <td >Gadu-Gadu:</td>
  25. <td ><input type=text name=user_gg_new value=\"$user_gg\" size=20></td>
  26. </tr>
  27. <tr>
  28. <td >E-mail:</td>
  29. <td ><input type=text name=user_mail_new value=\"$user_mail\" size=20></td>
  30. </tr>
  31. <tr>
  32. <td  colspan=2>&nbsp;</td>
  33. </tr>
  34. <tr>
  35. <td  colspan=2>
  36. <p align=center><b>Ustawienia hasła</b></td>
  37. </tr>
  38. <tr>
  39. <td >Aktualne hasło:</td>
  40. <td ><input type=text name=user_pass size=20></td>
  41. </tr>
  42. <tr>
  43. <td >&nbsp;</td>
  44. <td >&nbsp;</td>
  45. </tr>
  46. <tr>
  47. <td >Nowe hasło:</td>
  48. <td ><input type=text name=user_pass_new size=20></td>
  49. </tr>
  50. <tr>
  51. <td >Powtórz nowe hasło:</td>
  52. <td ><input type=text name=user_pass_new2 size=20></td>
  53. </tr>
  54. <tr>
  55. <td >&nbsp;</td>
  56. <td >&nbsp;</td>
  57. </tr>
  58. <tr>
  59. <td  colspan=2>
  60. <p align=center><input type=submit value=Zapisz name=B1></td>
  61. </tr>
  62. <tr>
  63. <td >&nbsp;</td>
  64. <td >&nbsp;</td>
  65. </tr>
  66. </table>
  67. </form>";
  68. } else {
  69. echo "Brak dostępu, zaloguj sie by mieć dostęp.."; }
  70.  
  71. if (!$new_gg)
  72. { echo "BRAK DANYCH!!!";  exit;}
  73. if ($user_pass_new != $user_pass_new2)
  74. { echo "OBA HASŁA NIE SĄ RÓWNE!!!";  exit;}
  75.  
  76. $link = mysql_connect("$db_host","$db_user", "$db_pass") or die ("Nie można nawiązać połączenia.");
  77. mysql_select_db("$db_name");
  78. $query="update users set
  79. user_mail ='$user_mail_new',
  80. user_gg ='$user_gg_new',
  81. user_pass='$user_pass_new',
  82. where user_login='$username'";
  83. $result= mysql_query($query, $link);
  84.  
  85. echo "DANE ZOSTAŁY ZMIENIONE :)";
  86. }
  87. ?>
Go to the top of the page
+Quote Post
bmL
post
Post #11





Grupa: Zarejestrowani
Postów: 301
Pomógł: 25
Dołączył: 15.07.2007
Skąd: Olsztyn

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


Spróbuj usnąć ostatnią klamrę }.
Go to the top of the page
+Quote Post

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: 24.08.2025 - 10:48