Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php][mysql] Brak komunikatu!
ManiQu
post
Post #1





Grupa: Zarejestrowani
Postów: 101
Pomógł: 0
Dołączył: 2.09.2007

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


Zrobiłem aktywacje email. Gdy ktos potwierdzi doda mu wartosc 1 do pola ok. W login.php zrobilem ze jesli wartosc pola ok==0 wywali komunikat. Ale figa. Funkcja message to komunikat. Doquery to mysql_query:
  1. <?php
  2. ...
  3. $login = doquery("SELECT * FROM {{table}} WHERE `username` = '".mysql_escape_string($_POST['username'])."' LIMIT 1","users",true);
  4.  
  5.  if($login) //Si se encuentra un usuario, $login es una array
  6.  { //Se identifica la contraseďż˝
  7.  
  8. if($login['password'] == md5($_POST['password']))
  9. {
  10. $aktywacja = doquery("SELECT ok FROM {{table}} WHERE `username` = '".mysql_escape_string($_POST['username'])."' LIMIT 1","users",true);
  11. if($aktywacja == 0){
  12. message('Musisz aktywowac konto. Po rejestracji został do Ciebie wysłany link aktywacyjny
     z danymi.'
    );
  13. }
  14. ...
  15. ?>
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
c3zi
post
Post #2





Grupa: Zarejestrowani
Postów: 266
Pomógł: 20
Dołączył: 15.11.2006
Skąd: Koszalin

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


  1. <?php
  2. $user_array = doquery("SELECT `email` FROM {{table}} WHERE `email` = '{$_POST['email']}' LIMIT 1","users",true);
  3. $md5newpass = md5($hashh);
  4.  
  5. if($user_array)
  6. {
  7.  doquery("UPDATE {{table}} SET `password`='{$md5newpass}' WHERE `email`='{$email}'",'users');
  8.  message('na podany przez Ciebie email wyslano haslo!');
  9. }
  10. else 
  11.  message('taki email nie istnieje!');
  12. ?>


Ten post edytował strife 30.09.2007, 16:48:33
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: 8.10.2025 - 18:27