Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › Programming › Other Programming › PHP Programming › PHP Guestbook

PHP Guestbook

Posts 1–4 of 4 · Page 1 of 1
ZE
Zebra
PHP Guestbook
Hey guys, here's the Guestbook i made.

Ok so lets start.
First make a new database named "guestbook", And execute this SQL Script:
Code:
CREATE TABLE messages(
id INT NOT NULL AUTO_INCREMENT,
PRIMARY KEY(id),
nick VARCHAR(20) NOT NULL,
message TEXT NOT NULL,
ip TEXT NOT NULL,
time TEXT NOT NULL
);
Now make three new PHP files.

1.index.php:
[html]
<!-- This Guestbook has been made By Zebra -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<title>Guestbook</title>
<style type="text/css">
body{
font-size:11pt;
font-family:Verdana;
}
</style>
<?php include "functions.php"; ?>
</head>

<body>
<table width="450" style="border:1px solid black;border-collapse:collapse;" align="center">
<th>Guestbook<hr /></th>
<?php ShowMsgs(); ?>
<tr>
<form action="" method="POST" style="text-align:center;">
<td>
<?php @Post($_POST['nick'],$_POST['msg'],$_POST['submit']); ?>
Nickname:<input type="text" name="nick" size="33" /><Br />
Message:<br />
<textarea name="msg" cols="35" rows="8" tabindex="100" ></textarea>
<br />
<input type="submit" name="submit" value="Post" />
</td>
</form>
</tr>
</table>
</body>

</html>
[/html]

2.config.php(Remember to edit the host,user,password):
[php]
<?php
$host = "localhost"; //Put here your mysql host
$user = "root"; //Put here you mysql user
$pass = "root"; //Put here you mysql pass
$db = "guestbook"; //Put here the DB your using

$conn = mysql_connect($host,$user,$pass) or die(mysql_error());
$sdb = mysql_select_db($db) or die(mysql_error());
?>
[/php]

3.functions.php:
[php]
<?php
include "config.php";
function ShowMsgs(){
$sq = mysql_query("SELECT * FROM `messages` ORDER BY `id` DESC");
while($row = mysql_fetch_array($sq)){
echo "
<tr>
<td>
" . $row['time'] . " - " . $row['nick'] . ":<br />" . nl2br(htmlentities($row['message'])) . "<br /><hr />
</td>
</tr>
";
}
}
function Post($nick,$msg,$sub){
if(isset($sub)){
$nick = mysql_real_escape_string($nick);
$msg = mysql_real_escape_string($msg);
$ip = $_SERVER['REMOTE_ADDR'];
$h = date("g") - 1;
$time = date($h . ":i A:j/n/Y");
if($nick == ""){
echo "<font color='red'>You must provide a Nickname.</font><br />";
}elseif(strlen($nick) > 20){
echo "<font color='red'>Your nick must be between 1 And 20 Charecters.</font><br />";
}elseif(strlen($msg) < 6){
echo "<font color='red'>Your Message is to short.</font><br />";
}elseif($msg == ""){
echo "<font color='red'>You must provide a Message.</font><br />";
}else{
$insert = mysql_query("INSERT INTO `messages` (`nick`,`message`,`ip`,`time`) VALUES ('" . $nick . "','" . $msg . "','" . $ip . "','" . $time . "') ");
if($insert == true){
Header("Location:index.php");
}else{
echo "<font color='red'>There was a problem posting your comment.</font><br />";
}
}
}
}
?>
[/php]

Ok, now you have your own Guestbook ^^.

Download files:http://mesolottery.com/other/Guestbook.zip

-Zebra
#1 · edited 16y ago · 16y ago
Ugleh
Ugleh
some users might not know how to set up a database, ill make a thread later but nice work.
#2 · 16y ago
ZE
Zebra
How they can not know it?
Its simple...
#3 · 16y ago
TR
Troy598
Yeah, I have the same problems of the people above me.[img]http://***********/12.jpg[/img]
#4 · edited 13y ago · 13y ago
Posts 1–4 of 4 · Page 1 of 1

Post a Reply

Similar Threads

  • e107 <= 0.6172 (resetcore.php) Remote SQL Injection Exploit:By RoB07 in Exploits
    4Last post 12y ago
  • Process_promocode.php[code]By ferrar1000 in WarRock - International Hacks
    22Last post 18y ago
  • PhP Programming SectionBy radnomguywfq3 in Suggestions, Requests & General Help
    8Last post 18y ago
  • [PHP]Based DoS BlockerBy Token in General Hacking
    0Last post 17y ago
  • Selling Phising files [Php & Mysql]By niek123 in Trade Accounts/Keys/Items
    7Last post 18y ago

Tags for this Thread

#guestbook#php