1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE></TITLE> <META NAME="Author" CONTENT=""> <META NAME="Keywords" CONTENT=""> <META NAME="Description" CONTENT=""> <link rel="stylesheet" href="style.css" type="text/css" media="screen" /> <META HTTP-EQUIV="refresh" content="2; URL=cambia.php"> </HEAD> <BODY> <? $pswold = md5($_POST['pswold']); $pswnew1 = md5($_POST['pswnew1']); $pswnew2 = md5($_POST['pswnew2']); $database = "Sql603025_1"; include("conn_param.php");
mysql_select_db($database, $conn);
$sql="select * from users where username='".$_POST['username']."' AND password='".$pswold."'";
$result = mysql_query($sql);
$row = mysql_fetch_array($result,MYSQL_ASSOC); $ID_user = $row['ID'];
if($row==false) { echo "<br> Errore inserimento Vecchia Password!!!"; echo $_GET['username']; }else { if($pswnew1 == $pswnew2) { include("setConn.php");
if ($db == FALSE) die ("Errore nella connessione.");
$sql = "UPDATE users SET username='".$_POST['username']."', password='".$pswnew1."' WHERE ID=".$ID_user; if(mysql_db_query($database, $sql, $db)) { echo " Password modificata!!!"; }else { echo " Erorre durante la modifica."; } mysql_close($db);
}else { echo " Errore Conferma Password."; } }
mysql_close($conn); ?> </BODY> </HTML>
|