-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfooterEdit.php
More file actions
70 lines (54 loc) · 2.11 KB
/
footerEdit.php
File metadata and controls
70 lines (54 loc) · 2.11 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
63
64
65
66
67
68
69
70
<?php
$conn = mysqli_connect("localhost", "root", "", "newdemo");
// Check connection
if($conn -> connect_error)
{
die("Connection failed:".$conn -> connect_error);
}
$sql = "SELECT * from footer;";
//$result = $conn -> query($sql);
$result = mysqli_query($conn, $sql);
$row = mysqli_fetch_assoc($result);
$address = $row['address'];
$phone = $row['phone'];
$email = $row['email'];
$whatsapp = $row['whatsapp'];
$url = $row['url'];
///////////////--------edit--------/////////////
if( isset($_POST['submit']) ){
$address = $_POST['address'];
$phone = $_POST['phone'];
$email = $_POST['email'];
$whatsapp = $_POST['whatsapp'];
$url = $_POST['url'];
}
$sql = "update footer set address='$address', phone='$phone', email='$email', whatsapp='$whatsapp', url='$url' ";
$result = $conn->query($sql);
//echo"<script>window.location.assign('aboutUs.php')</script>"
?>
<!DOCTYPE html>
<html>
<head>
<title></title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<form action="footerEdit.php" method="post">
Address:<br>
<textarea rows="4" cols="50" type="text" name="address" size="100%" placeholder="<?php echo $row["address"]; ?>"></textarea><br>
Phone Number :<br>
<input type="text" name="phone" style="width: 50em;" value="<?php echo $row["phone"]; ?>"><br>
Email :<br>
<input type="text" name="email" style="width: 50em;" value="<?php echo $row["email"]; ?>"><br>
WhatsApp Number :<br>
<input type="text" name="whatsapp" style="width: 50em;" value="<?php echo $row["whatsapp"]; ?>"><br>
Website URL :<br>
<input type="text" name="url" style="width: 50em;" value="<?php echo $row["url"]; ?>"><br>
<input type="submit" name="submit" value="submit">
<br /><br />
</form>
</body>
</html>