Codice PHP:
<?php
/* - - - - - - - - - - - - - - -
| BCSoft Scripts
| Guestbook V0.1
| Boris Carollo
| [email]bcsoft@lycos.it[/email]
- - - - - - - - - - - - - - - */
// NON MODIFICARE NIENTE DOPO QUESTA LINEA -- DO NOT MODIFY ANYTHING AFTER THIS LINE
require("mysql.inc.php");
$qstr1 = $_REQUEST["act"];
$qstr2 = $_REQUEST["cat"];
if($qstr1 == "") {
$link = mysql_connect($host1, $user1, $pass1) or die("
<html>
<head>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">
<meta name=\"author\" content=\"Boris Carollo - BCSoft\">
<meta name=\"description\" content=\"BCSoft Scripts - Guestbook V0.1\">
<meta name=\"keywords\" content=\"bcsoft, scripts, free, php, guestbook, mysql, scripting\">
<meta http-equiv=\"Refresh\" content=\"2; url=index.php?act=Install\">
<title>BCSoft Guestbook V0.1</title>
<style type=\"text/css\">
body {
font-family:Verdana;
font-size:10px;
}
table {
font-family:Verdana;
font-size:10px;
}
input {
font-family:Verdana;
font-size:10px;
}
textarea {
font-family:Verdana;
font-size:10px;
}
</style>
</head>
<body bgcolor=\"#ffffff\" link=\"#000000\" alink=\"#000000\" vlink=\"#000000\">
<div align=\"center\">
<table bgcolor=\"#c8c8c8\" border=\"0\" cellspacing=\"1\" cellpadding=\"1\">
<tr>
<td width=\"500\" height=\"40\" bgcolor=\"#ffff99\">
<div align=\"center\">
Errore durante la selezione dello script!
Assicurati di aver inserito i dati corretti.
</div>
</td>
</tr>
</table>
</div>
</body>
</html>
");
mysql_select_db($data1) or die("
<html>
<head>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">
<meta name=\"author\" content=\"Boris Carollo - BCSoft\">
<meta name=\"description\" content=\"BCSoft Scripts - Guestbook V0.1\">
<meta name=\"keywords\" content=\"bcsoft, scripts, free, php, guestbook, mysql, scripting\">
<meta http-equiv=\"Refresh\" content=\"2; url=index.php?act=Install\">
<title>BCSoft Guestbook V0.1</title>
<style type=\"text/css\">
body {
font-family:Verdana;
font-size:10px;
}
table {
font-family:Verdana;
font-size:10px;
}
input {
font-family:Verdana;
font-size:10px;
}
textarea {
font-family:Verdana;
font-size:10px;
}
</style>
</head>
<body bgcolor=\"#ffffff\" link=\"#000000\" alink=\"#000000\" vlink=\"#000000\">
<div align=\"center\">
<table bgcolor=\"#c8c8c8\" border=\"0\" cellspacing=\"1\" cellpadding=\"1\">
<tr>
<td width=\"500\" height=\"40\" bgcolor=\"#ffff99\">
<div align=\"center\">
Errore durante l'installazione dello script!
Assicurati di aver inserito i dati corretti.
</div>
</td>
</tr>
</table>
</div>
</body>
</html>
");
$query1 = mysql_query("SELECT COUNT(Message) FROM bcsoft_gbook");
$query2 = mysql_query("SELECT * FROM bcsoft_gbook ORDER BY ID DESC");
while($row1 = mysql_fetch_array($query1)) {
echo("
<html>
<head>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">
<meta name=\"author\" content=\"Boris Carollo - BCSoft\">
<meta name=\"description\" content=\"BCSoft Scripts - Guestbook V0.1\">
<meta name=\"keywords\" content=\"bcsoft, scripts, free, php, guestbook, mysql, scripting\">
<title>BCSoft Guestbook V0.1</title>
<style type=\"text/css\">
body {
font-family:Verdana;
font-size:10px;
}
table {
font-family:Verdana;
font-size:10px;
}
input {
font-family:Verdana;
font-size:10px;
}
textarea {
font-family:Verdana;
font-size:10px;
}
</style>
</head>
<body bgcolor=\"#ffffff\" link=\"#000000\" alink=\"#000000\" vlink=\"#000000\">
<div align=\"center\">
<table bgcolor=\"#c8c8c8\" border=\"0\" cellspacing=\"1\" cellpadding=\"1\">
<tr>
<td width=\"150\" height=\"20\" bgcolor=\"#ffff99\">
Messaggi: [b]$row1[0][/b]
</td>
<td width=\"350\" height=\"20\" bgcolor=\"#ffff99\">
<div align=\"right\">
<img src=\"emoticons/write.gif\" border=\"0\"> <a href=\"index.php?act=Write\">[ Scrivi ]</a>
</div>
</td>
</tr>
");
}
while($row2 = mysql_fetch_array($query2)) {
echo("
<tr>
<td width=\"150\" height=\"50\" bgcolor=\"#ffffff\">
Nome: [b]$row2[Name][/b]
Data: [b]$row2[Date][/b]
Ora: [b]$row2[Time][/b]
</td>
<td width=\"350\" height=\"50\" bgcolor=\"#ffffff\">
<div align=\"center\">
[b]$row2[Title][b]
</div>
$row2[Message]
<div align=\"right\">
<img src=\"emoticons/drop.gif\" border=\"0\"> <a href=\"index.php?act=Delete&cat=$row2[ID]\">[ Cancella ]</a>
</td>
</tr>
");
}
echo("
</table>
</div>
</body>
</html>
");
mysql_close($link);
}
if($qstr1 == "Write") {
echo("
<html>
<head>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">
<meta name=\"author\" content=\"Boris Carollo - BCSoft\">
<meta name=\"description\" content=\"BCSoft Scripts - Guestbook V0.1\">
<meta name=\"keywords\" content=\"bcsoft, scripts, free, php, guestbook, mysql, scripting\">
<title>BCSoft Guestbook V0.1</title>
<style type=\"text/css\">
body {
font-family:Verdana;
font-size:10px;
}
table {
font-family:Verdana;
font-size:10px;
}
input {
font-family:Verdana;
font-size:10px;
}
textarea {
font-family:Verdana;
font-size:10px;
}
</style>
</head>
<body bgcolor=\"#ffffff\" link=\"#000000\" alink=\"#000000\" vlink=\"#000000\">
<div align=\"center\">
<form method=\"post\" action=\"index.php?act=Write&cat=Post\">
<table bgcolor=\"#c8c8c8\" border=\"0\" cellspacing=\"1\" cellpadding=\"1\">
<tr>
<td width=\"500\" height=\"20\" bgcolor=\"#ffff99\" colspan=\"2\">
<div align=\"center\">
Scrivi
</div>
</td>
</tr>
<tr>
<td width=\"150\" height=\"40\" bgcolor=\"#ffffff\">
<div align=\"center\">
Nome
</div>
</td>
<td width=\"350\" height=\"40\" bgcolor=\"#ffffff\">
<div align=\"center\">
<input type=\"text\" name=\"name\" size=\"30\" maxlength=\"12\">
</div>
</td>
</tr>
<tr>
<td width=\"150\" height=\"40\" bgcolor=\"#ffffff\">
<div align=\"center\">
Titolo
</div>
</td>
<td width=\"350\" height=\"40\" bgcolor=\"#ffffff\">
<div align=\"center\">
<input type=\"text\" name=\"title\" size=\"30\" maxlength=\"30\">
</div>
</td>
</tr>
<tr>
<td width=\"150\" height=\"80\" bgcolor=\"#ffffff\">
<div align=\"center\">
Messaggio
<a href=\"index.php?act=Write&cat=Emoticons\">[ Smilies ]</a>
</div>
</td>
<td width=\"350\" height=\"80\" bgcolor=\"#ffffff\">
<div align=\"center\">
<textarea type=\"text\" name=\"message\" cols=\"40\" rows=\"4\"></textarea>
</div>
</td>
</tr>
</table>
<input type=\"submit\" value=\" Invia \"> <input type=\"reset\" value=\" Cancella \">
</form>
");
if($qstr2 == "Emoticons") {
echo("
<table bgcolor=\"#c8c8c8\" border=\"0\" cellspacing=\"1\" cellpadding=\"1\">
<tr>
<td width=\"250\" height=\"20\" bgcolor=\"#ffff99\">
<div align=\"center\">
Scrivi...
</div>
</td>
<td width=\"250\" height=\"20\" bgcolor=\"#ffff99\">
<div align=\"center\">
... e compare
</div>
</td>
</tr>
<tr>
<td width=\"250\" height=\"40\" bgcolor=\"#ffffff\">
<div align=\"center\">
[b]:)[/b]
</div>
</td>
<td width=\"250\" height=\"40\" bgcolor=\"#ffffff\">
<div align=\"center\">
<img src=\"emoticons/01.gif\" border=\"0\">
</div>
</td>
</tr>
<tr>
<td width=\"250\" height=\"40\" bgcolor=\"#ffffff\">
<div align=\"center\">
[b]:([/b]
</div>
</td>
<td width=\"250\" height=\"40\" bgcolor=\"#ffffff\">
<div align=\"center\">
<img src=\"emoticons/02.gif\" border=\"0\">
</div>
</td>
</tr>
<tr>
<td width=\"250\" height=\"40\" bgcolor=\"#ffffff\">
<div align=\"center\">
[b]:D[/b]
</div>
</td>
<td width=\"250\" height=\"40\" bgcolor=\"#ffffff\">
<div align=\"center\">
<img src=\"emoticons/03.gif\">
</div>
</td>
</tr>
<tr>
<td width=\"250\" height=\"40\" bgcolor=\"#ffffff\">
<div align=\"center\">
[b]:F[/b]
</div>
</td>
<td width=\"250\" height=\"40\" bgcolor=\"#ffffff\">
<div align=\"center\">
<img src=\"emoticons/04.gif\">
</div>
</td>
</tr>
<tr>
<td width=\"250\" height=\"40\" bgcolor=\"#ffffff\">
<div align=\"center\">
[b]:@[/b]
</div>
</td>
<td width=\"250\" height=\"40\" bgcolor=\"#ffffff\">
<div align=\"center\">
<img src=\"emoticons/05.gif\">
</div>
</td>
</tr>
<tr>
<td width=\"250\" height=\"40\" bgcolor=\"#ffffff\">
<div align=\"center\">
[b]:O[/b]
</div>
</td>
<td width=\"250\" height=\"40\" bgcolor=\"#ffffff\">
<div align=\"center\">
<img src=\"emoticons/06.gif\">
</div>
</td>
</tr>
<tr>
<td width=\"250\" height=\"40\" bgcolor=\"#ffffff\">
<div align=\"center\">
[b]:cry:[/b]
</div>
</td>
<td width=\"250\" height=\"40\" bgcolor=\"#ffffff\">
<div align=\"center\">
<img src=\"emoticons/07.gif\">
</div>
</td>
</tr>
<tr>
<td width=\"250\" height=\"40\" bgcolor=\"#ffffff\">
<div align=\"center\">
[b]:sbav:[/b]
</div>
</td>
<td width=\"250\" height=\"40\" bgcolor=\"#ffffff\">
<div align=\"center\">
<img src=\"emoticons/08.gif\">
</div>
</td>
</tr>
<tr>
<td width=\"250\" height=\"40\" bgcolor=\"#ffffff\">
<div align=\"center\">
[b]:stordita:[/b]
</div>
</td>
<td width=\"250\" height=\"40\" bgcolor=\"#ffffff\">
<div align=\"center\">
<img src=\"emoticons/09.gif\">
</div>
</td>
</tr>
<tr>
<td width=\"250\" height=\"40\" bgcolor=\"#ffffff\">
<div align=\"center\">
[b]:mad:[/b]
</div>
</td>
<td width=\"250\" height=\"40\" bgcolor=\"#ffffff\">
<div align=\"center\">
<img src=\"emoticons/10.gif\">
</div>
</td>
</tr>
<tr>
<td width=\"250\" height=\"40\" bgcolor=\"#ffffff\">
<div align=\"center\">
[b];)[/b]
</div>
</td>
<td width=\"250\" height=\"40\" bgcolor=\"#ffffff\">
<div align=\"center\">
<img src=\"emoticons/11.gif\">
</div>
</td>
</tr>
<tr>
<td width=\"250\" height=\"40\" bgcolor=\"#ffffff\">
<div align=\"center\">
[b]:z[/b]
</div>
</td>
<td width=\"250\" height=\"40\" bgcolor=\"#ffffff\">
<div align=\"center\">
<img src=\"emoticons/12.gif\">
</div>
</td>
</tr>
<tr>
<td width=\"250\" height=\"40\" bgcolor=\"#ffffff\">
<div align=\"center\">
[b]:sbonk[/b]
</div>
</td>
<td width=\"250\" height=\"40\" bgcolor=\"#ffffff\">
<div align=\"center\">
<img src=\"emoticons/13.gif\">
</div>
</td>
</tr>
<tr>
<td width=\"250\" height=\"40\" bgcolor=\"#ffffff\">
<div align=\"center\">
[b]:?[/b]
</div>
</td>
<td width=\"250\" height=\"40\" bgcolor=\"#ffffff\">
<div align=\"center\">
<img src=\"emoticons/14.gif\">
</div>
</td>
</tr>
<tr>
<td width=\"250\" height=\"40\" bgcolor=\"#ffffff\">
<div align=\"center\">
[b]:sexpulp:[/b]
</div>
</td>
<td width=\"250\" height=\"40\" bgcolor=\"#ffffff\">
<div align=\"center\">
<img src=\"emoticons/15.gif\">
</div>
</td>
</tr>
</table>
</div>
</body>
</html>
");
}
if($qstr2 == "Post") {
$name2 = $_REQUEST["name"];
$title2 = $_REQUEST["title"];
$message2 = $_REQUEST["message"];
$date = date("d/m/Y");
$time = date("H:i");
$message2 = stripslashes($message2);
$title2 = stripslashes($title2);
$name2 = stripslashes($name2);
$name2 = eregi_replace("<","<",$name2);
$name2 = eregi_replace("'","'",$name2);
$title2 = eregi_replace("<","<",$title2);
$message2 = eregi_replace("<","<",$message2);
$message2 = eregi_replace("'","'",$message2);
$emoticons = array (
":)" => "emoticons/01.gif",
":(" => "emoticons/02.gif",
":D" => "emoticons/03.gif",
":F" => "emoticons/04.gif",
":@" => "emoticons/05.gif",
":O" => "emoticons/06.gif",
":cry:" => "emoticons/07.gif",
":sbav:" => "emoticons/08.gif",
":stordita:" => "emoticons/9.gif",
":mad:" => "emoticons/10.gif",
";)" => "emoticons/11.gif",
":z" => "emoticons/12.gif",
":sbonk:" => "emoticons/13.gif",
":?" => "emoticons/14.gif",
":sexpulp" => "emoticons/15.gif"
);