Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
website
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
COM S 319
website
Commits
cc4aca43
Commit
cc4aca43
authored
Mar 23, 2015
by
Ryan Wade
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
file was in wrong feature branch.
parent
d6f13967
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
103 deletions
+0
-103
editPage.php
editPage.php
+0
-103
No files found.
editPage.php
deleted
100644 → 0
View file @
d6f13967
<?php
include
"./SQL.php"
;
session_start
();
if
(
false
&&
!
$_SESSION
[
'isAuthenticated'
])
{
header
(
'Location: login.html'
);
die
();
}
else
{
if
(
$_SERVER
[
'REQUEST_METHOD'
]
==
'POST'
)
{
if
(
isset
(
$_POST
[
'id'
])
and
isset
(
$_POST
[
'title'
])
and
isset
(
$_POST
[
'desc'
]))
{
$host
=
"localhost"
;
$username
=
"root"
;
$pass
=
"root"
;
$database
=
"website"
;
$conn
=
new
mysqli
(
$host
,
$username
,
$pass
,
$database
);
if
(
$conn
->
connect_error
)
{
die
();
}
$sql
=
"INSERT INTO pages VALUES ("
.
$_POST
[
'id'
]
.
", "
.
$_POST
[
'pid'
]
.
", "
.
"'"
.
$_POST
[
'title'
]
.
"', "
.
"'"
.
$_POST
[
'desc'
]
.
"', "
.
"'"
.
$_POST
[
'image'
]
.
"', "
.
"'"
.
$_POST
[
'content'
]
.
"', "
.
$_POST
[
'publish'
]
.
") ON DUPLICATE KEY UPDATE "
.
"pid = "
.
$_POST
[
'pid'
]
.
", "
.
"title = '"
.
$_POST
[
'title'
]
.
"', "
.
"description = '"
.
$_POST
[
'desc'
]
.
"', "
.
"image = '"
.
$_POST
[
'image'
]
.
"', "
.
"content = '"
.
$_POST
[
'content'
]
.
"', "
.
"publish = "
.
$_POST
[
'publish'
]
.
";"
;
$conn
->
query
(
$sql
);
$conn
->
commit
();
}
echo
$_POST
[
'content'
];
die
();
}
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">
<html>
<head>
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=Cp1252"
>
<title>
Edit Page
</title>
<script
src=
"http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"
></script>
</head>
<body>
<table><tr><td>
<div
id=
"form"
>
<table>
<?php
$sql
=
new
SQL
();
if
(
!
isset
(
$_GET
[
'id'
]))
{
$_GET
[
'id'
]
=
0
;
}
$page
=
$sql
->
GET_TABLE
(
0
)
->
GET_ROW
(
$_GET
[
'id'
])
->
data
;
echo
"<tr><td>Page Id</td><td><input type=
\"
number
\"
id=
\"
id
\"
value=
\"
"
.
$page
[
0
]
.
"
\"
></input></td></tr>
\n
"
;
echo
"<tr><td>Parent Id</td><td><input type=
\"
number
\"
id=
\"
pid
\"
value=
\"
"
.
$page
[
1
]
.
"
\"
></input></td></tr>
\n
"
;
echo
"<tr><td>Title</td><td><input type=
\"
text
\"
id=
\"
title
\"
value=
\"
"
.
$page
[
2
]
.
"
\"
></input></td></tr>
\n
"
;
echo
"<tr><td>Description</td><td><input type=
\"
text
\"
id=
\"
desc
\"
value=
\"
"
.
$page
[
3
]
.
"
\"
></input></td></tr>
\n
"
;
echo
"<tr><td>Image</td><td><input type=
\"
text
\"
id=
\"
image
\"
value=
\"
"
.
$page
[
4
]
.
"
\"
></input></td></tr>
\n
"
;
echo
"<tr><td>Content</td><td><textarea id=
\"
content
\"
>"
.
$page
[
5
]
.
"</textarea></td></tr>
\n
"
;
echo
"<tr><td>Publish?</td><td><input type=
\"
checkbox
\"
"
.
(
$page
[
6
]
?
" checked"
:
""
)
.
"></td></tr>
\n
"
;
echo
"<tr><td><button id=
\"
submit
\"
>Save</button></td></tr>
\n
"
;
?>
</table>
<script>
$
(
"
#submit
"
).
click
(
function
(){
$
.
post
(
"
editPage.php
"
,
{
id
:
$
(
"
#id
"
).
val
(),
pid
:
$
(
"
#pid
"
).
val
(),
title
:
$
(
"
#title
"
).
val
(),
desc
:
$
(
"
#desc
"
).
val
(),
image
:
$
(
"
#image
"
).
val
(),
content
:
$
(
"
#content
"
).
val
(),
publish
:
$
(
"
#publish
"
).
is
(
"
:checked
"
)
},
function
(
data
,
status
){
$
(
"
#preview
"
).
html
(
data
);
});
});
</script>
</div>
</td>
<td
style=
"vertical-align: top;"
>
<div
id=
"preview"
>
</div>
</td></tr></table>
</body>
</html>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment