-
Notifications
You must be signed in to change notification settings - Fork 0
/
log2.php
66 lines (46 loc) · 1.25 KB
/
log2.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
<?php
ob_start();
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "face";
if ($_SERVER["REQUEST_METHOD"] == "POST") {
// collect value of input field
$fname = $_POST['notes1'];
try {
$conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
// set the PDO error mode to exception
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
// sql to delete a record
$sql = "DELETE FROM data WHERE id=$fname";
// use exec() because no results are returned
$conn->exec($sql);
}
catch(PDOException $e)
{
echo $sql . "<br>" . $e->getMessage();
}
$conn = null;
}
header("Location: log.php");
ob_end_flush();
?>
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="5.css">
</head>
<body>
<script type="text/javascript">
<!--
function Redirect() {
window.history.back();
// location.reload();
}
//-->
</script>
<div class="cover">
<div class="tx">YOUR NOTES HAS BEEN DELETED!!!LOST DATA CAN NOT BE RETRIEVED.</div>
<div class="tx1"><input type="submit" name="tf" value="YEP!!!" onclick="Redirect();"></div>
</body>