-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdelete.php
More file actions
24 lines (20 loc) · 834 Bytes
/
delete.php
File metadata and controls
24 lines (20 loc) · 834 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
session_start();
mysql_connect('mysql6.000webhost.com', 'a6519930_user', 'ecommerce2012') or die (mysql_error());
mysql_select_db('a6519930_base') or die (mysql_error());
if(mysql_num_rows(mysql_query("SELECT * from users WHERE email='" . $_SESSION['name'] . "'")) == 1){
$email=$_SESSION['name'];
$password=$_POST['password'];
$password=mysql_real_escape_string($password);
$password=crypt($password,$email);//hash the password
if(mysql_num_rows(mysql_query("Select * FROM users WHERE email='$email' and password='$password'"))==1){
mysql_query("DELETE FROM users WHERE email='" . $_SESSION['name'] . "'");
session_destroy();
header("location:index.php");
}
else{
$_SESSION['message'] = 'Error. Please contact your local Richard Li or Raymond Tang';
header("location:login.php");
}
}
?>