Hello People,
I'm building a login script. If the user fills in their username/password and that is correct, then they come on another page.
There I want people to change their password.
It works with a mysql database. I'll post my whole code here.
To check the password I used:
if($passoud == "$password" && "$passnew" == "$passnew2") {
mysql_query("UPDATE from projectx where login = '$login'");
}
And then, I didn't know what to do next 🙁
please people help me!
Please post also tips for me.
Thanks!
<?php
include("config.inc.php");
if($action == "newpassword") {
if("$passoud" == "$password2" && "$passnew" == "$passnew2") {
echo "Password moet NU worden verandert..";
}}
elseif($action == "controleer") {
@mysql_connect("$db_host","$db_user","$db_pass");
@mysql_select_db("projectx");
$sql = mysql_query("SELECT * FROM login where login='$login'");
while($row = mysql_fetch_array($sql)){
$login2 = $row["login"];
$password2 = $row["password"];
// Controleren
if($login == "$login2" && "$password" == "$password2") {
echo "<head><title>Gebruikers Informatie</title></head><body>";
echo "<center><b><font face=\"$font\" size=\"$size\" color=\"$color\">Gebruikers Profiel</font></center></b><br><br>";
echo "Login naam <b>$login</b><br><br><br>";
echo "Als je wil kun je je password hieronder veranderen: <br><br>";
echo "<form action=\"login.php?action=newpassword\" method=\"post\"><p>Oude Password: <input name=passoud size=40><br><br>
Nieuw Password: <input name=passnew size=40<br>
Nogmaals nieuw: <input name=passnew2 size=40><br><br><input type=submit value=Password Veranderen><br></p></form>
";
}
else {
echo "login incorrect";
}
}}
else {
?>
<head><title>ProjectX</title>
</head>
<body>
<center><font face=verdana size=5>ProjectX</font></center><br><br>
<font face=verdana size=2>Log hieronder in met je login en password....<br>
<br>
<form action="login.php?action=controleer" method="POST">Login : <input name="login" size="40"><br>Password: <input type="password" name="password"><br><input type="submit" value="Inloggen"></form>
<br>
</body
<?
}
?>