forked from AmateurIndian/Vapor_Social_Gaming
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnewPass.php
30 lines (23 loc) · 1022 Bytes
/
newPass.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
<?php
mysql_connect("localhost", "root", "sarj-93") or die("mysql connection is failure.");
mysql_select_db("cs353") or die("Database does not exists.");
if (isset($_POST['submit'])){
$userid = $_GET['id'];
$pass=mysql_escape_string($_POST['password']);
if (!$_POST['password']){
echo ("<SCRIPT LANGUAGE='JavaScript'>
window.alert('Please fill all login details')
window.location.href='index.php'
</SCRIPT>");
exit();
}
else{
$query = "UPDATE `Login` SET `password` = '$pass' WHERE `Login`.`userId` = '$userid'";
$value = mysql_query($query);
echo ("<SCRIPT LANGUAGE='JavaScript'>
window.alert('Password changed successfully')
window.location.href='home.php?edit=Y&id=$userid'
</SCRIPT>");
}
}
?>