Problemen met Email en Wachtwoord aanpassen

Gestart doorMarv22 reacties26 weergaven

23 berichten · pagina 2 van 2

Berichten
9.953
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Idd, viel mij ook al op.
0
Marv

Lid · Topicstarter

Berichten
3.092
Reputatie
1
Punten
0,21
Lid sinds
Laatst gezien
is een script uit een open-source cms.

het is de tabel users en kolom password smile
0
Tgrm

Lid

Berichten
2.133
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Efferinie schreef:
is een script uit een open-source cms.

het is de tabel users en kolom password smile
Pas dat dan aan?confused
mysql_query("UPDATE users SET password = " . (sha1($_POST[ww])) . " WHERE id = " . $_SESSION[id] . "");


Is toch niet zo moeilijk? dizzy
0
Marv

Lid · Topicstarter

Berichten
3.092
Reputatie
1
Punten
0,21
Lid sinds
Laatst gezien
Dan werkt hij niet goed.
Er is iets met de ifs
0
Tgrm

Lid

Berichten
2.133
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Efferinie schreef:
Dan werkt hij niet goed.
Er is iets met de ifs
Ja, er klopt een boel niet aan die ifs... das et nadeel van niet zelf scripten... fix het wel ff

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]submit[/COLOR][COLOR= #007700]]))
{[/COLOR]
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]oud[/COLOR][COLOR= #007700]]))
    {[/COLOR]
            
        [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]Vul je oude wachtwoord in[/COLOR][COLOR= #007700];
            
    }[/COLOR]
    [URL="http://www.php.net/else"]else[/URL]
    [COLOR= #007700]{[/COLOR]
        [COLOR= #0000BB]$qQuery[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$mysql[/COLOR][COLOR= #007700]->[/COLOR]query[COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT password FROM users WHERE id = "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]" AND password = "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$mysql[/COLOR][COLOR= #007700]->[/COLOR]real_escape[COLOR= #007700]([/COLOR][URL="http://www.php.net/sha1"]sha1[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]oud[/COLOR][COLOR= #007700]])) .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
            
        [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$mysql[/COLOR][COLOR= #007700]->[/COLOR]num_rows[COLOR= #007700]([/COLOR][COLOR= #0000BB]$qQuery[/COLOR][COLOR= #007700]) ==[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700])
        {[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]Je wachtwoord klopt niet[/COLOR][COLOR= #007700];
        }[/COLOR]
        [URL="http://www.php.net/else"]else[/URL]
        [COLOR= #007700]{[/COLOR]
            [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]nieuw[/COLOR][COLOR= #007700]]))
            {[/COLOR]
                [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]Vul een nieuw wachtwoord in[/COLOR][COLOR= #007700];
            }[/COLOR]
            [URL="http://www.php.net/else"]else[/URL]
            [COLOR= #007700]{[/COLOR]
                [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]nieuw[/COLOR][COLOR= #007700]] !=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]controle[/COLOR][COLOR= #007700]])
                {[/COLOR]
                    [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]Geen gelijke wachtwoorden[/COLOR][COLOR= #007700];
                }[/COLOR]
                [URL="http://www.php.net/else"]else[/URL]
                [COLOR= #007700]{[/COLOR]
                    [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE users SET password = "[/COLOR] [COLOR= #007700]. ([/COLOR][URL="http://www.php.net/sha1"]sha1[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]nieuw[/COLOR][COLOR= #007700]])) .[/COLOR] [COLOR= #DD0000]" WHERE id = "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
                    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<strong>Je wachtwoord is veranderd!</strong>[/COLOR][COLOR= #007700];
                }
            }
        }
    }
}[/COLOR]
    
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<form action="" method="post">
    <table>
    <tr>
      <td style="width: 250px;"><label>oud:</label></td>
      <td style="width: 250px;"><input class= "input" type="password" name="oud" /></td>
    </tr>
    <tr>
      <td style="width: 250px;"><label>nieuw:</label></td>
      <td style="width: 250px;"><input class= "input" type="password" name="nieuw" /></td>
    </tr>
    <tr>
      <td style="width: 250px;"><label>controle<em></em>:</label></td>
      <td style="width: 250px;"><input class= "input" type="password" name="controle" /></td>
    </tr>
    <tr>
      <td style="width: 250px;"></td>
      <td style="width: 250px;"><input class= "formbutton" type="submit" name="submit" value="Veranderen!" /></td>
    </tr>
    </table>
    </form>[/COLOR][COLOR= #007700];[/COLOR]

?>


zo goed?
0
Marv

Lid · Topicstarter

Berichten
3.092
Reputatie
1
Punten
0,21
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]submit[/COLOR][COLOR= #007700]]))
{[/COLOR]
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]oud[/COLOR][COLOR= #007700]]))
    {[/COLOR]
            
        [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]Vul je oude wachtwoord in[/COLOR][COLOR= #007700];
            
    }[/COLOR]
    [URL="http://www.php.net/else"]else[/URL]
    [COLOR= #007700]{[/COLOR]
        [COLOR= #0000BB]$qQuery[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT mail FROM users WHERE id = "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]" AND password = "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/sha1"]sha1[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]oud[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
            
        [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$qQuery[/COLOR][COLOR= #007700]) ==[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700])
        {[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]Je wachtwoord klopt niet[/COLOR][COLOR= #007700];
        }[/COLOR]
        [URL="http://www.php.net/else"]else[/URL]
        [COLOR= #007700]{[/COLOR]
            [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]nieuw[/COLOR][COLOR= #007700]]))
            {[/COLOR]
                [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]Vul een nieuw wachtwoord in[/COLOR][COLOR= #007700];
            }[/COLOR]
            [URL="http://www.php.net/else"]else[/URL]
            [COLOR= #007700]{[/COLOR]
                [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]nieuw[/COLOR][COLOR= #007700]] !=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]controle[/COLOR][COLOR= #007700]])
                {[/COLOR]
                    [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]Geen gelijke wachtwoorden[/COLOR][COLOR= #007700];
                }[/COLOR]
                [URL="http://www.php.net/else"]else[/URL]
                [COLOR= #007700]{[/COLOR]
                    [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE users SET password = "[/COLOR] [COLOR= #007700]. ([/COLOR][URL="http://www.php.net/sha1"]sha1[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]nieuw[/COLOR][COLOR= #007700]])) .[/COLOR] [COLOR= #DD0000]" WHERE id = "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
                    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<strong>Je wachtwoord is veranderd!</strong>[/COLOR][COLOR= #007700];
                }
            }
        }
    }
}[/COLOR]
    
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<form action="" method="post">
    <table>
    <tr>
      <td style="width: 250px;"><label>oud:</label></td>
      <td style="width: 250px;"><input class= "input" type="password" name="oud" /></td>
    </tr>
    <tr>
      <td style="width: 250px;"><label>nieuw:</label></td>
      <td style="width: 250px;"><input class= "input" type="password" name="nieuw" /></td>
    </tr>
    <tr>
      <td style="width: 250px;"><label>controle<em></em>:</label></td>
      <td style="width: 250px;"><input class= "input" type="password" name="controle" /></td>
    </tr>
    <tr>
      <td style="width: 250px;"></td>
      <td style="width: 250px;"><input class= "formbutton" type="submit" name="submit" value="Veranderen!" /></td>
    </tr>
    </table>
    </form>[/COLOR][COLOR= #007700];[/COLOR]

?>


Zo. Moest ook nog wat dingen Repareren.
Alleen het controle stukje moet nog. want hij geeft telkens aan dat het oude Wachtwoord niet klopt
0
Marv

Lid · Topicstarter

Berichten
3.092
Reputatie
1
Punten
0,21
Lid sinds
Laatst gezien
Is geregeld @ PM

Slotje
0
Marv

Lid · Topicstarter

Berichten
3.092
Reputatie
1
Punten
0,21
Lid sinds
Laatst gezien
Nog niet Opgelost.

Bumper
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren