-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmin_contactEdit.php
More file actions
25 lines (25 loc) · 892 Bytes
/
admin_contactEdit.php
File metadata and controls
25 lines (25 loc) · 892 Bytes
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
<div id="admin_contactEdit" style="display: none">
<h3> Edit contact tekst</h3>
<form method="post" action="admin_index.php">
<textarea name="Text" style='min-height: 300px; min-width: 900px; max-height: 300px; max-width: 900px;'><?php
$con = mysqli_connect($host, $username, $password, $db_name);
$query = "SELECT text FROM `info` WHERE `page`='contact'";
if($result = mysqli_query($con, $query))
{
while ($row = mysqli_fetch_row($result))
{
echo $row[0];
}
}
?></textarea>
<input type="submit" name="SaveButton" value="Save" id="SaveButton">
</form>
</div>
<?php
if (isset($_POST["SaveButton"])) {
$Contact = $_POST["Text"];
$con = mysqli_connect($host, $username, $password, $db_name);
$query = "UPDATE `info` SET `text`='$Contact' WHERE `page`='contact'";
mysqli_query($con, $query);
}
?>