Non capendo io una cippa di php, ho fatto delle prove, ma non funziona.
IL codice php che serve dovrebbe essere questo:
Codice PHP:
<?php
class TSguestbook extends SupportFunctions {
# EDIT THE NAME OF YOUR WEBPAGE #
var $pageName = "xxx.php";
// define datafiles
var $guestbook_dat = "xxx.dat";
var $entry_html_code = "xxx.php";
// define variables
var $name;
var $email;
var $spaziotempo;
var $homepage;
var $entry;
var $timestamp;
var $admin_mail = "xxx@xxx.it";
// add new entry
function _addEntry($name, $email, $spaziotempo, $homepage, $entry) {
$this->name = stripslashes($name);
$this->email = $email;
$this->spaziotempo = $spaziotempo;
$this->homepage = $homepage;
$this->entry = stripslashes($this->_replace_nl($entry));
$this->timestamp = date('d.m.Y \a\l\l\e H:i');
$line = $this->name."|".$this->email."|".$this->spaziotempo."|".$this->homepage."|"
.$this->entry."|".$this->timestamp."|\r\n";
$this->_writeLine($this->guestbook_dat, $line, "a");
$this->_sendMail();
return 1;
}
// display entries
function _displayEntry($start_entry, $MAX_PER_PAGE) {
$end = FALSE;
$guestbook_array = file($this->guestbook_dat);
for ($i = sizeof($guestbook_array) - $start_entry, $j = $MAX_PER_PAGE; $i >= 0 && $j > 0; $i--, $j--) {
$guestbook_line = explode("|", $guestbook_array[$i]);
# empty strings must be substituted by " " to display the HTML correctly
for ($k = 0; $k < sizeof($guestbook_line); $k++) {
if (!strcmp($guestbook_line[$k], ""))
$guestbook_line[$k] = " ";
}
$this->name = $guestbook_line[0];
$this->email = $guestbook_line[1];
$this->spaziotempo = $guestbook_line[2];
$this->homepage = $guestbook_line[3];
$this->entry = $guestbook_line[4];
$this->timestamp = $guestbook_line[5];
# check, if there are any older entries in the datafile
if ($i < 1)
$end = TRUE;
include($this->entry_html_code);
}
return $end;
}
// display links to browse the entries
function _displayLinks($start_entry, $end) {
# this will add a link to newer entries, if there are some
if (($back = $start_entry - 10) > 0) {
$link = "<a href=\"$this->pageName?start_entry=$back\">Indietro</a> ";
}
# this will add a link to older entries, if there are some
if (!$end) {
$start_entry += 10;
$link .= "<a href=\"$this->pageName?start_entry=$start_entry\">Avanti</a>";
}
return $link;
}
// send email-notification
function _sendMail() {
$mail_string = "Il guestbook di LV4ER è stato firmato.\n\nSent
by $this->name ($this->email) on $this->timestamp:\n\n$this->entry";
mail ($this->admin_mail, "New guestbook entry on LV4ER", $mail_string, "From: Sito LV4ER");
return 1;
}
// check entry
function _checkEntry($entry) {
$this->entry = $entry;
if ($entry == "") {
# user pressed the return key instead of the tabulator key, so the entry is empty
return 0;
} else return 1;
}
}
?>
La textarea è identificata con ENTRY.
Dove inserisco uno degli esempi della pagina che mi è stata suggerita?
Ho provato ad inserirne uno in fondo al codice php, ma non funziona, il codice html non vien disabilitato, ovvero non viene trasformato in solo testo..
grazie