Ciao scusatemi ma nei post precedenti non ho trato niente per il reimposta password(non il recupera).
cripava
@cripava
Post creati da cripava
-
RE: [Tutorial] Area privata
-
RE: [Tutorial] Area privata
io avevo fatto queato ma nn funziona[php]<?php
// Includo la connessione al database
require('../area_privata/config.php');$user = $SESSION['userloggato'];
if ($user) {//user is logged in
if ($_POST['submit']) {
// check fields
$oldpassword = md5($_POST['vpass']);
$newpassword = md5($_POST['pass']);
$repeatnewpassword = md5 ($_POST['pass2']);//connect db
$db_host = "localhost";
$db_user = "ciberioegiro";
$db_password = "miapass";
$db_name = "my_ciberioegiro";//connetto il database
$db = mysql_connect($db_host, $db_user, $db_password) or die ('Errore durante la connessione');
mysql_select_db($db_name, $db) or die ('Errore durante la selezione del db');$queryget = mysql_query("SELECT pass FROM WHERE user='$user'") or die ("Query didnt work");
$row = mysql_fetch_assoc($queryget);$oldpassworddb = $row['pass'];
echo $olrdpassworddb."<br>";
echo $oldpassword."<br>";//check passwords
if ($oldpassword==$oldpassworddb)
{// check two new passwords
if ($newpasword==$repeatnewpassword){
//success
//change password in db$querychange = mysql_query("UPDATE utenti SET pass='$newpassword' WHERE user='$user'") or die ("Your password has been changed. <a href='index.php'>Rerturn to main page.");
} else {
print ("New passwords don't match!");
}
} else {
print ("Old password doesnt match!");
}
} else {
echo "";
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html xmlns="w3.org/1999/xhtml">
<?php include("../area_privata/configuratoriphp/head.php")?>
<div id="container">
<?php include("../area_privata/configuratoriphp/header.php")?>
<?php include("../area_privata/configuratoriphp/nav.php")?>
<?php include("../area_privata/configuratoriphp/colsx.php")?>
<div id="coldx"><div id="contenuti"> <div class="boxcontenuti">
<!--inizio contenuto principale-->
<!--<p> </p>-->
<br /><h2>AREA RISERVATA DOCENTI</h2>
<div id="centra_ingresso">
<form class="ingresso" name="logForm" id="logForm" action='cpassword.php' method='post'>
<fieldset><legend><strong>Modulo cambia password</strong></legend> <div> <label for="username">Username</label> <input class="required grigio" id="user" type='text' name='user' value="<?php echo $_SESSION['userloggato'];?>" /> </div> <div> <label for="vecchiapassword">Vecchia password</label> <input class="required password" id="vpass" type='password' name='vpass' /> </div> <div> <label for="password">Nuova password</label> <input class="required password" id="pass" type='password' name='pass' /></p> </div> <div> <label for="password2">Ripeti nuova password</label> <input class="required password" id="pass2" type='password' name='pass2' /> </div> <div> <p><input type='submit' value='CAMBIA PASSWORD'> </p> </div> </fieldset>
</form>
</div><!--fine contenuto principale-->
</div>
</div><!--fine sottocontenitore centrale-->
</div>
</div>
<?php include("configuratoriphp/footer.php");?>
</body>
</html>[/php] -
RE: [Tutorial] Area privata
Scusatemi non mi sono espresso corrretamente intendevo una pagina con un form del tipo nome utente,vecchia password,nuova password,conferma passsword
-
RE: [Tutorial] Area privata
ciao scusate potreste postarmi l codice per una pagina che serva a cambiare password