io di php non ci capisco nulla, cmq sono riuscito ugualmente ad utilizzare uno script gratuito di html.it, installarlo e tradurlo.. VVoVe:
tutto funzia
però ho due problemini, la pagina in questione è questa
http://www.scheletri.com/public/ware_gb.php
1- vorrei che i testi degli annunci venissero visualizzati più piccoli, un size 2 ad esempio
2- vorrei centrare "inserisci" e "home page" in fondo alla pagina...
è stato difficile cmq questo è il codice php... dove sbaglio?
<?
/* Welcome to the WebWorkz Ware Guestbook. This system will allow you to have users post comments to your web site and is fully-customizable. Set the variables below to customize your guestbook. */
/* Customization Variables */
// Your web site address
$yoursiteaddress = "http://www.scheletri.com";
// Your web site name
$yoursitename = "Scheletri.com";
// Max entries per page
$maxperpage = "10";
// Allow HTML in guestbook submissions? (0 = No, 1 = Yes)
$allowhtml = "1";
/* --------------- DO NOT EDIT BELOW THIS LINE -------------- */
/* --------------- PRE-CONFIGURED LAYOUTS ----------------- */
$addform = "<FORM ACTION=\"$PHP_SELF?addsubmit=true\" METHOD=\"POST\">\n";
$addform .= "<table border=\"0\" cols=\"2\" width=\"500\">\n";
$addform .= "<tr>\n";
$addform .= "<td width=\"100\">Nome:</td>\n";
$addform .= "<td width=\"400\"><input type=\"text\" name=\"name\"></td>\n";
$addform .= "</tr><tr>\n";
$addform .= "<td width=\"100\">E-Mail:</td>\n";
$addform .= "<td width=\"400\"><input type=\"text\" name=\"email\"></td>\n";
$addform .= "</tr><tr>\n";
$addform .= "<td width=\"100\">Vendo/compro:</td>\n";
$addform .= "<td width=\"400\"><input type=\"text\" name=\"sitename\"></td>\n";
$addform .= "</tr><tr>\n";
$addform .= "<td width=\"100\">Indirizzo del tuo sito:</td>\n";
$addform .= "<td width=\"400\"><input type=\"text\" name=\"siteurl\" value=\"http://\"></td>\n";
$addform .= "</tr><tr>\n";
$addform .= "<td width=\"100\">Il tuo annuncio:</td>\n";
$addform .= "<td width=\"400\"><TEXTAREA name=\"message\" cols=\"50\" rows=\"15\"></TEXTAREA></td>\n";
$addform .= "</tr><tr>\n";
$addform .= "<td width=\"100\"></td>\n";
$addform .= "<td width=\"400\"><input type=\"submit\" value=\"Inserisci il tuo annuncio\">\n";
$addform .= "</tr></table>\n";
$addform .= "</FORM>\n";
include ("header.inc");
include ("entries.inc");
include ("entrycounter.inc");
IF (!isset($add) and !isset($addsubmit))
{
echo ("<A HREF=\"$PHP_SELF?add=true\">Inserisci</a> - ");
echo ("<A HREF=\"$yoursiteaddress\">Home page di $yoursitename</a>
");
$maxperpage = $maxperpage + 0;
IF (!isset($start))
{
$start = $lastentry;
}
$end = $start - $maxperpage;
$count = $start;
while ($count <= $start and $count > $end and $count > 0)
{
$entryid = "entry" . $count;
echo ("<table border=0 cols=2 width=500>");
IF (isset($$entryid))
{
while (list ($variable, $value) = each($$entryid))
{
IF ($allowhtml == 0)
{
$value = Strip_tags($value);
}
IF ($variable == "E-Mail")
{
echo ("<tr>\n<td width=100>\n$variable:\n</td>\n<td width=400>\n<A HREF=\"mailto:$value\">$value</a>\n</td>\n</tr>\n");
}
ELSE IF ($variable == "Site URL")
{
echo ("<tr>\n<td width=100>\n$variable:\n</td>\n<td width=400>\n<A HREF=\"$value\">$value</a>\n</td>\n</tr>\n");
}
ELSE IF ($variable == "Message")
{
$value = str_replace("\\\"", "\"", $value);
echo ("<tr>\n<td width=100>\n$variable:\n</td>\n<td width=400>\n$value\n</td>\n</tr>\n");
}
ELSE
{
echo ("<tr>\n<td width=100>\n$variable:\n</td>\n<td width=400>\n$value\n</td>\n</tr>\n");
}
}
echo ("</table><hr width=100% noshade>");
}
ELSE
{
$end = $end - 1;
}
$count = $count - 1;
}
$entryid = "entry" . $count;
IF ($start != $lastentry)
{
$start = $start + $maxperpage;
echo (" <A HREF=\"$PHP_SELF?start=$start\"><<< Indietro</a>");
echo (" ");
}
IF (isset($$entryid))
{
echo (" ");
echo (" <A HREF=\"$PHP_SELF?start=$count\">Avanti >>></a>");
}
echo ("
<center><A HREF=\"$PHP_SELF?add=true\">Inserisci</a> - ");
echo ("<A HREF=\"$yoursiteaddress\">Home page di $yoursitename</a>");
}
ELSE IF (isset($add))
{
echo ("$addform");
}
ELSE IF (isset($addsubmit))
{
$required = Array (
'Name' => $name,
'E-Mail' => $email,
'Message' => $message);
while (list($caption, $variable) = each($required))
{
$errorcount = 0;
IF ($variable == "")
{
++$errorcount;
echo ("Inserire '$caption' Casella vuota.
");
}
}
IF ($errorcount == 0)
{
$filename = "entrycounter.inc";
$increment = $lastentry + 1;
$incrementoutput = "<? $" . "lastentry = " . $increment . "; ?>";
$write = fopen($filename, "w");
fwrite ($write, $incrementoutput);
fclose($write);
$entryid = "entry" . $increment;
$datetime = date ("l F jS @ g:iA T");
$addentry = "<? $" . $entryid .
" = Array ( " .
"'Nome' => '$name', " .
"'E-Mail' => '$email', " .
"'Data inserimento' => '$datetime', " .
"'Vendo/compro' => '$sitename', " .
"'Il tuo sito' => '$siteurl', " .
"'Annuncio' => '$message'); ?>";
$filename2 = "entries.inc";
$write2 = fopen($filename2, "a");
fwrite ($write2, $addentry . "\r\n\r\n");
fclose($write2);
echo ("Grazie per aver inserito il tuo annuncio!
Torna agli altri <A HREF=\"$PHP_SELF\">annunci</a> del Mercatino di Scheletri.");
}
ELSE
{
echo ("
<font color=\"red\">Prego torna indietro e riprova.</font>");
}
}
echo ("<center>Script Free By WebWorkz Ware <A HREF=\"http://www.webworkzware.com\">http://www.webworkzware.com</a></center>");
include ("footer.inc");
?>