-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
67 changed files
with
3,484 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
<?php | ||
|
||
/*******w******** | ||
Name: John Kelvin A. Valerio | ||
Date: 03/13/23 | ||
Description: Project | ||
****************/ | ||
|
||
require('connect.php'); | ||
//require('authenticate.php'); | ||
|
||
|
||
$id = 0; | ||
if (isset($_GET['id'])) { | ||
$id = $_GET['id']; | ||
} | ||
|
||
function filteredData() | ||
{ | ||
if (filter_input(INPUT_GET, 'id', FILTER_VALIDATE_INT) === 0) { | ||
return true; | ||
} else { | ||
return filter_input(INPUT_GET, 'id', FILTER_VALIDATE_INT); | ||
} | ||
} | ||
|
||
if (filteredData()) { | ||
// SQL is written as a String. | ||
$query = "SELECT * FROM content_post WHERE post_id = $id"; | ||
|
||
// A PDO::Statement is prepared from the query. | ||
$statement = $db->prepare($query); | ||
|
||
// Execution on the DB server is delayed until we execute(). | ||
$statement->execute(); | ||
|
||
$blogData = $statement->fetch(); | ||
} | ||
?> | ||
|
||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<link rel="stylesheet" href="main.css"> | ||
<title>Edit this Post!</title> | ||
</head> | ||
|
||
<body> | ||
<!-- Remember that alternative syntax is good and html inside php is bad --> | ||
<div id="wrapper"> | ||
<div id="header"> | ||
<h1><a href="index.php">Kelvin's Blog- Edit Post</a></h1> | ||
</div> | ||
<ul class="menu"> | ||
<li><a href="index.php">Home</a></li> | ||
<li><a href="create.php">New Post</a></li> | ||
</ul> | ||
<div id="all_blogs"> | ||
<form action="post.php" method="post"> | ||
<fieldset> | ||
<legend>Edit Blog Post</legend> | ||
<p> | ||
<label for="title">Title</label> | ||
<input name="title" id="title" value="<?= $blogData['title']?>" > | ||
</p> | ||
<p> | ||
<label for="content">Content</label> | ||
<textarea name="content" id="content"><?= $blogData['content'] ?></textarea> | ||
</p> | ||
<p> | ||
<input type="hidden" name="id" value=<?= $id ?> > | ||
<input type="submit" name="update" value="Update" > | ||
<input type="submit" name="delete" value="Delete" | ||
onclick="return confirm('Are you sure you wish to delete this post?')" > | ||
</p> | ||
</fieldset> | ||
</form> | ||
</div> | ||
<div id="footer"> | ||
Copywrong 2023 - No Rights Reserved | ||
</div> | ||
</div> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
This is where language files should be placed. | ||
|
||
Please DO NOT translate these directly use this service: https://www.transifex.com/projects/p/tinymce/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2022 Ephox Corporation DBA Tiny Technologies, Inc. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.