-
Notifications
You must be signed in to change notification settings - Fork 1
/
ganti_password.php
executable file
·157 lines (130 loc) · 3.62 KB
/
ganti_password.php
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<?php
////////////////////////////////////////////////////////////
// SMS BIASAWAE v0.1 //
// oleh : Agus Muhajir //
////////////////////////////////////////////////////////////
// blog/situs/milist : //
// http://hajirodeon.wordpress.com/ //
// http://sisfokol.wordpress.com/ //
// http://yahoogroup.com/groups/sisfokol/ //
// http://yahoogroup.com/groups/linuxbiasawae/ //
////////////////////////////////////////////////////////////
// e-mail : //
// hajirodeon@yahoo.com //
////////////////////////////////////////////////////////////
// hp/sms : //
// 081-829-88-54 //
////////////////////////////////////////////////////////////
session_start();
//require
require("inc/config.php");
require("inc/fungsi.php");
require("inc/koneksi.php");
require("inc/cek.php");
nocache;
//nilai
$filenya = "ganti_password.php";
$judul = "Ganti Password";
//PROSES ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//simpan
if ($_POST['btnSMP'])
{
//ambil nilai
$passlama = nosql($_POST["passlama"]);
$passbaru = nosql($_POST["passbaru"]);
$passbaru2 = nosql($_POST["passbaru2"]);
//cek
//nek null
if ((empty($passlama)) OR (empty($passbaru)) OR (empty($passbaru2)))
{
//re-direct
$pesan = "Input Tidak Lengkap. Harap Diulangi...!!";
pekem($pesan,$filenya);
exit();
}
//nek pass baru gak sama
else if ($passbaru != $passbaru2)
{
//re-direct
$pesan = "Password Baru Tidak Sama. Harap Diulangi...!!";
pekem($pesan,$filenya);
exit();
}
else
{
//query
$q = mysql_query("SELECT * FROM admin ".
"WHERE username = '$username_session' ".
"AND password = '$passlama'");
$row = mysql_fetch_assoc($q);
$total = mysql_num_rows($q);
//cek
if ($total != 0)
{
//perintah SQL
mysql_query("UPDATE admin SET password = '$passbaru'");
//diskonek
xfree($q);
xfree($qbw);
xclose($koneksi);
//auto-kembali
$pesan = "PASSWORD BERHASIL DIGANTI.";
$ke = "main.php";
pekem($pesan, $ke);
exit();
}
else
{
//diskonek
xfree($q);
xfree($qbw);
xclose($koneksi);
//re-direct
$pesan = "PASSWORD LAMA TIDAK COCOK. HARAP DIULANGI...!!!";
pekem($pesan, $filenya);
exit();
}
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//view //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
echo '<html>
<head>
<title>'.$judul.'</title>
</head>
<body>
<form action="'.$filenya.'" method="post" name="formx">';
require("inc/header.php");
echo '<TABLE border="0">
<tr valign="top">
<td valign="top">';
require("inc/menu.php");
echo '</td>
<td width="700" align="top">
<p>
<big>
<strong>'.$judul.'</strong>
</big>
</p>
<p>Password Lama : <br>
<input name="passlama" type="password" size="15" maxlength="15">
</p>
<p>Password Baru : <br>
<input name="passbaru" type="password" size="15" maxlength="15">
</p>
<p>RE-Password Baru : <br>
<input name="passbaru2" type="password" size="15" maxlength="15">
</p>
<p>
<input name="btnSMP" type="submit" value="SIMPAN">
<input name="btnBTL" type="reset" value="BATAL">
</p>
</td>
</tr>
</TABLE>
<br>';
require("inc/footer.php");
echo '</form>
</body>
</html>';
?>