-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdelete.php
More file actions
62 lines (55 loc) · 1.97 KB
/
Copy pathdelete.php
File metadata and controls
62 lines (55 loc) · 1.97 KB
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
<?php
session_start();
require_once("pdo.php");
require_once("util.php");
?>
<html>
<head>
<title>Kritika Datar</title>
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"
integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7"
crossorigin="anonymous">
<!-- Optional theme -->
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css"
integrity="sha384-fLW2N01lMqjakBkx3l/M9EahuwpSfeNvV63J5ezn3uZzapT0u7EYsXMjQV+0En5r"
crossorigin="anonymous">
</head>
<body>
<div class="container">
<h1>Deleting Profile</h1>
<br>
<?php
// session_start();
// $servername = "localhost";
// $username = "root";
// $password = "root";
// $dbname = "resume";
try{
$conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$pstmt = $conn->prepare('SELECT first_name, last_name from profile where profile_id= :pi');
$var = $_GET['profile_id'];
$pstmt ->execute(array(':pi' => $var));
$row = $pstmt->fetch(PDO::FETCH_ASSOC);
?>
First Name: <?php echo $row['first_name']; ?><br>
Last Name: <?php echo $row['last_name']; ?><br>
<form action="index.php" method="post">
<input type="text" value="<?php echo $var; ?>" name="profile_id" hidden>
<input type="submit" name="submit3" value="Delete">
<input type="submit" name="cancel" value="Cancel">
<!-- <button onclick="location.href='index.php';">Delete</button>
<button onclick="location.href='index.php';">Cancel</button> -->
</form>
<?php
}
catch(PDOException $e){
echo "Exception caught: ".$e->getMessage() ;
}
$conn = null;
?>
</div>
</body>
</html>