@ -0,0 +1,58 @@ | |||
-- phpMyAdmin SQL Dump | |||
-- version 5.0.2 | |||
-- https://www.phpmyadmin.net/ | |||
-- | |||
-- PHP Version: 7.4.6 | |||
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; | |||
START TRANSACTION; | |||
SET time_zone = "+00:00"; | |||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; | |||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; | |||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; | |||
/*!40101 SET NAMES utf8mb4 */; | |||
-- | |||
-- Database: `coalfax` | |||
-- | |||
-- -------------------------------------------------------- | |||
-- | |||
-- Table structure for table `coalburners` | |||
-- | |||
CREATE TABLE `coalburners` ( | |||
`id` mediumint(9) NOT NULL, | |||
`name` varchar(255) NOT NULL, | |||
`proofs` varchar(2083) NOT NULL, | |||
`body` text NOT NULL, | |||
`images` varchar(255) NOT NULL | |||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; | |||
-- | |||
-- Indexes for dumped tables | |||
-- | |||
-- | |||
-- Indexes for table `coalburners` | |||
-- | |||
ALTER TABLE `coalburners` | |||
ADD PRIMARY KEY (`id`); | |||
-- | |||
-- AUTO_INCREMENT for dumped tables | |||
-- | |||
-- | |||
-- AUTO_INCREMENT for table `coalburners` | |||
-- | |||
ALTER TABLE `coalburners` | |||
MODIFY `id` mediumint(9) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13; | |||
COMMIT; | |||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; | |||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; | |||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; |
@ -0,0 +1,5 @@ | |||
{ | |||
"require": { | |||
"dapphp/securimage": "^4.0" | |||
} | |||
} |
@ -0,0 +1,71 @@ | |||
{ | |||
"_readme": [ | |||
"This file locks the dependencies of your project to a known state", | |||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", | |||
"This file is @generated automatically" | |||
], | |||
"content-hash": "3f808c44ea98f22ebc47f6e2479cafd7", | |||
"packages": [ | |||
{ | |||
"name": "dapphp/securimage", | |||
"version": "4.0.1", | |||
"source": { | |||
"type": "git", | |||
"url": "https://github.com/dapphp/securimage.git", | |||
"reference": "09d735e30378f506c5dab900af31321351f46e0d" | |||
}, | |||
"dist": { | |||
"type": "zip", | |||
"url": "https://api.github.com/repos/dapphp/securimage/zipball/09d735e30378f506c5dab900af31321351f46e0d", | |||
"reference": "09d735e30378f506c5dab900af31321351f46e0d", | |||
"shasum": "" | |||
}, | |||
"require": { | |||
"ext-gd": "*", | |||
"php": ">=5.4" | |||
}, | |||
"suggest": { | |||
"ext-pdo": "For database storage support", | |||
"ext-pdo_mysql": "For MySQL database support", | |||
"ext-pdo_sqlite": "For SQLite3 database support" | |||
}, | |||
"type": "library", | |||
"autoload": { | |||
"classmap": [ | |||
"securimage.php" | |||
], | |||
"psr-4": { | |||
"Securimage\\": "./" | |||
} | |||
}, | |||
"notification-url": "https://packagist.org/downloads/", | |||
"license": [ | |||
"BSD-3-Clause" | |||
], | |||
"authors": [ | |||
{ | |||
"name": "Drew Phillips", | |||
"email": "drew@drew-phillips.com" | |||
} | |||
], | |||
"description": "PHP CAPTCHA Library", | |||
"homepage": "https://www.phpcaptcha.org", | |||
"keywords": [ | |||
"Forms", | |||
"anti-spam", | |||
"captcha", | |||
"security" | |||
], | |||
"time": "2018-03-08T17:54:43+00:00" | |||
} | |||
], | |||
"packages-dev": [], | |||
"aliases": [], | |||
"minimum-stability": "stable", | |||
"stability-flags": [], | |||
"prefer-stable": false, | |||
"prefer-lowest": false, | |||
"platform": [], | |||
"platform-dev": [], | |||
"plugin-api-version": "1.1.0" | |||
} |
@ -0,0 +1,8 @@ | |||
<?php | |||
$servername = "localhost"; | |||
$username = "root"; | |||
$password = ""; | |||
$dbname = "coalfax"; | |||
$conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password); | |||
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); |
@ -0,0 +1,79 @@ | |||
<!DOCTYPE html> | |||
<head> | |||
<meta charset="UTF-8"> | |||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |||
<title>Coalfax Revamped</title> | |||
<meta name="description" content="Get the Coalfax!"> | |||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |||
<link rel="stylesheet" href="/css/main.css"> | |||
<style> | |||
table, th, td { | |||
border: 1px solid black; | |||
} | |||
th, td { | |||
padding: 10px; | |||
} | |||
div.coalburner_display { | |||
white-space: normal; | |||
} | |||
</style> | |||
</head> | |||
<body style="background-color:dimgray;text-align:center"> | |||
<h1>Welcome to Coalfax Revamped, The coalburner registry!</h1> | |||
<div class="coalburner_submission"> | |||
<form name="submission_forum" action="submit_coalburner.php" method="POST" enctype="multipart/form-data"> | |||
Coalburner Name: <input type="text" id="name" name="name" required> | |||
<br> | |||
Proofs & Sources: <input type="text" id="proofs" name="proofs" required> | |||
<br> | |||
Body: <br><textarea id="body" name="body" rows="10" cols="50" required></textarea><br> | |||
Image: <input type="file" id="images" name="images" required> | |||
<br> | |||
<br> | |||
<img id="captcha" src="/vendor/dapphp/securimage/securimage_show.php" alt="CAPTCHA Image" /> | |||
<input type="text" id="captcha_code" name="captcha_code" size="10" maxlength="6" required /> | |||
<a href="#" | |||
onclick="document.getElementById('captcha').src = '/vendor/dapphp/securimage/securimage_show.php?' + Math.random(); return false">[ | |||
Different Image ]</a> | |||
<br> | |||
<br> | |||
<input type="submit"> | |||
</form> | |||
</div> | |||
<br> | |||
<div class="coalburner_display" style="overflow-x:auto;"> | |||
<table style="float:center; table-layout: auto; width: 100%"> | |||
<thead> | |||
<tr> | |||
<th>ID</th> | |||
<th>Name</th> | |||
<th>Proofs</th> | |||
<th>Body</th> | |||
<th>Image(s)</th> | |||
</tr> | |||
</thead> | |||
<tbody> | |||
<?php | |||
require_once('connect.php'); | |||
$result = $conn->prepare("SELECT * FROM coalburners ORDER BY id ASC"); | |||
$result->execute(); | |||
for ($i=0; $row = $result->fetch(); $i++) { | |||
?> | |||
<tr> | |||
<td style="word-wrap: break-word"><label><?php echo $row['id']; ?></label></td> | |||
<td style="word-wrap: break-word"><label><?php echo $row['name']; ?></label></td> | |||
<td style="word-wrap: break-word"><label><?php echo $row['proofs']; ?></label></td> | |||
<td style="word-wrap: break-word"><label><?php echo $row['body']; ?></label></td> | |||
<td><label><img src="/images/<?php echo $row['images']; ?>" width="400" height="500"></label></td> | |||
</tr> | |||
<?php | |||
} ?> | |||
</tbody> | |||
</table> | |||
</div> | |||
</body> | |||
</html> |