forked from ng3w-uv/WTL_Gaming_website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate.php
109 lines (101 loc) · 5.15 KB
/
update.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
<?php
$servername = "sql6.freemysqlhosting.net";
$dbname = "sql6467698";
$username = "sql6467698";
$password = "883w66QmSt";
try {
$conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$id=$_POST['id'];
$facts = $conn->query("SELECT * FROM facts where id=$id")->fetchAll();
} catch(PDOException $e) {
echo "Connection failed: " . $e->getMessage();
}
?>
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>Ng3w Gaming</title>
<!--CSS-->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<!-- style css -->
<link rel="stylesheet" type="text/css" href="css/style.css">
<!-- Responsive-->
<link rel="stylesheet" type="text/css" href="css/responsive.css">
<!-- fevicon -->
<link rel="icon" href="images/fevicon.png" type="image/gif" />
<!-- Scrollbar Custom CSS -->
<link rel="stylesheet" href="css/jquery.mCustomScrollbar.min.css">
<!-- Tweaks for older IEs-->
<link rel="stylesheet" href="https://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fancybox/2.1.5/jquery.fancybox.min.css" media="screen">
</head>
<body class="main-layout">
<!--NavBar-->
<header>
<div class="header-top">
<?php session_start(); include('Header.php');
?>
</div>
</header>
<div id="booktable" class="contact">
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="titlepage">
<h3 style="color:black;">Update</h3>
</div>
</div>
</div>
<div class="white_bg">
<div class="row">
<div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 text-center">
<div class="contact">
<form action="save.php" method="post">
<div class="row">
<?php foreach ($facts as $fact) {
?>
<div class="col-sm-12">
<input class="contactus" placeholder="Heading" type="text" name="heading" value="<?php echo $fact['heading']; ?>" required>
</div>
<div class="col-sm-12">
<textarea class="contactus" placeholder="Description" name="descp" required><?php echo $fact['descp'] ?></textarea>
</div>
<div class="col-sm-12">
<!-- <input class="contactus" type="file" name="image" required>-->
</div>
<div class="col-sm-12">
<input type="hidden" name="id" value="<?php echo $fact['id']; ?>">
<button class="btn btn-success">Submit</button>
</div>
<?php
} ?>
</div>
</form>
</div>
</div>
</div>
<div class="error">
<?php if (isset($_SESSION['error'])) {
echo $_SESSION['error'];
unset($_SESSION['error']);
} ?>
</div>
<div class="success">
<?php if (isset($_SESSION['success'])) {
echo $_SESSION['success'];
unset($_SESSION['success']);
} ?>
</div>
</div>
</div>
</div>
<!--Footer-->
<?php include('Footer.php') ?>
<!--JS-->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
</body>
</html>