Repository navigation
Expand file tree
/
Copy pathedit.php
More file actions
63 lines (52 loc) · 1.79 KB
/
Copy pathedit.php
File metadata and controls
63 lines (52 loc) · 1.79 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
<?php
//$linkID = mysql_connect("localhost", "cyberia", "cyberia");
//mysql_select_db("cyberia", $linkID);
include("db.php");
$thispage = $_GET["p"];
if ($thispage!="")
{
$getpage = "SELECT * FROM content WHERE page_id = $thispage";
$getpageresult = $linkID->query($getpage);
$page = $getpageresult->fetch_assoc();
//print_r($page);
}
if ($_POST["submit"] == "Submit")
{
$page_id = $_POST["page_id"];
//echo $id;
$title = $_POST["title"];
$keywords = $_POST["keywords"];
$description = addslashes($_POST["description"]);
$content=addslashes($_POST["content"]);
$updatequery = "UPDATE `content` SET title = '$title', keywords='$keywords',description = '$description', content = '$content'
WHERE page_id=$page_id";
//echo $insertquery;
echo "Page update";
$updateresult = $linkID->query($updatequery);
}
else
{
printform($page);
}
//print_form();
function printform($page)
{
$page_id = $page["page_id"];
//echo $id;
$title = $page["title"];
$description = $page["description"];
$content = $page["content"];
$keywords = $page["keywords"];
echo "
<table border=1 cellpadding=4 cellspacing=0 width=100%>
<form method=\"post\" name=\"editForm\" action = \"$_SERVER[PHP_SELF]?t=edit\">
<input type=\"hidden\" name =\"page_id\" value =\"$page_id\"></input>
<tr><td>Title</td><td><input type=\"text\" name=\"title\" value=\"$title\" size=60></input></td></tr>
<tr><td>Keywords</td><td><input type=\"text\" name=\"keywords\" value=\"$keywords\" size=80></input></td></tr>
<tr><td>Description</td><td><input type=\"text\" name=\"description\" value=\"$description\" size=80></input></td></tr>
<tr><td>Content</td><td><textarea name=\"content\" value=\"\" rows=5 cols = 60>$content</textarea></input></td></tr>
<tr><td></td><td><input type=\"submit\" name=\"submit\" value =\"Submit\"></tr>
</form>
</table>";
}
?>