-
Notifications
You must be signed in to change notification settings - Fork 0
/
update.php
39 lines (36 loc) · 1.13 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
<!DOCTYPE html>
<html lang="en">
<title>
Update
</title>
<head>
<body>
<div>
<form action="" method="POST">
<div>
<input type="text" id="title" name="title" placeholder="Enter Your Title" require="required"><br><br>
<input type="text" id="uptitle" name="uptitle" placeholder="Update Title Name" require="required"><br><br>
<input type="text" id="desc" name="updesc" placeholder="Update Desc Name" require="required"><br><br>
</div>
<div>
<input type="submit" name="submit" value="Update">
</div>
</form>
</div>
</body>
</head>
</html>
<?php
include('dbcon.php');
$con =mysqli_connect($server,$user,$password,$db);
$sql = 'SELECT * FROM `perm_admin`';
$title=$_POST['title'];
$uptitle=$_POST['uptitle'];
$updesc=$_POST['updesc'];
echo $title;
echo $uptitle;
echo $updesc;
if(isset($_POST['submit'])){
mysqli_query($con,"UPDATE `post` SET `dbtitle`='$uptitle',`dbdesc`='$updesc' WHERE dbtitle='$title'");
}
?>