Гостевая книга Joomla — Phoca Guestbook. Скрипт гостевой книги на PHP Установка и русификация Phoca Guestbook

For HTML codes, guestbook programming might seem unchallenging at first, and rightly so. When you see a guestbook, basic information is requested and it appears that anyone with a fundamental knowledge of the HTML programming language can write guestbook HTML codes. However, guestbooks, from the best to the worst, require a bit more skill than you think.

What is a Guestbook?

A guestbook is an online way to let visitors to your site comment or request information. Most guestbooks post what is written to the webpage so that everyone can read guest comments. The most common items you see on a guestbook are:

  • Name or Username
  • Where they reside (though you can set the HTML code to hide this fact)
  • Email (again, you can hide this fact and have it sent only to your email for communication purposes
  • Comments
  • Some guestbooks forego a comments section for a quick survey. You can usually find questions like "What did you think of this site: good, decent, bad, awesome" or "Was the information provided: enough, not enough, just right"
  • Options to request a reply or other information
Related Articles

Guestbooks can be programmed to send this information to an email address of your choice so that you don"t have to continually log into the site to view guestbook entries.

Where to Find HTML Codes, Guestbook

Whether you know HTML programming, you are a beginning web designer or you simply want a guestbook on your site, using prewritten HTML codes can save you time. The codes you can find online are typically well-tested and provide the most basic programming needed for easy-to-use guestbooks.

  • The code at HTML Comment Box provides the basic outline of an HTML code guestbook. All you need to do is customize the text to your needs and for your domain name. Instructions are provided at the beginning of the page. The code includes lines for name and address.
  • For a large selection of HTML codes and scripts, visit . With such a varied and large selection, you should be able to find one that works into the website you are creating. You can choose from basic guestbooks to more advanced programming that includes drop down menus and code for Macs and Linux machines. The codes are only 30-day free trials, so if you find a set of codes you like you"ll have to pay for the full use.
  • At Freebok you can input some basic information about what text you want on your guestbook and the website will generate the code for you. Afterwards, you can customize the guestbook even more by creating a template and editing the code in Freebok"s template layout mode. Other instructions are available on the site to help you with certain links you may need. You do need to sign up for an account in order to use Freebok.
  • To quickly add a guestbook with just a comment box, go to Guestbook Code . The initial code is already generated, but there are five options you can check and uncheck in order to alter the code slightly:
    • Collapse Guest Book. This includes a link that can open and close the guestbook on the webpage you insert it on.
    • Put Guest Book At Top. If this is unchecked, the guestbook and comment box will appear below any entries in the list.
    • Show Submission Date of Entries. This will add a date and time. The time will be the user"s local time zone, not yours.
    • Profanity Filter. Deletes any profanities that people may write.
    • You can also change the number of comments that are posted to the page for others to read. Minimum is one and maximum is one hundred. It"s recommended that you set it between five to twenty-five.

В данном уроке мы создадим гостевую книгу на PHP с использованием AJAX. Записи будут храниться в базе данных. Таблица будет содержать следующую информацию: имя отправителя, адрес email, IP адрес и дата-время последней записи. Будет использоваться jQuery (для реализации AJAX). Также будет реализована простая защита от спама - можно размещать не более одной записи каждые 10 минут.

Шаг 1. SQL

Для работы нашего приложения требуется создать таблицу:

CREATE TABLE IF NOT EXISTS `s178_guestbook` (`id` int(10) unsigned NOT NULL auto_increment, `name` varchar(255) default "", `email` varchar(255) default "", `description` varchar(255) default "", `when` int(11) NOT NULL default "0", `ip` varchar(20) default NULL, PRIMARY KEY (`id`)) ENGINE=MyISAM DEFAULT CHARSET=utf8;

Шаг 2. PHP

Основной файл будет содержать следующий код:

guestbook.php

Гостевая книга Добавьте ваш отзыв здесь function submitComment(e) { var name = $("#name").val(); var email = $("#email").val(); var text = $("#text").val(); if (name && email && text) { $.post("guestbook.php", { "name": name, "email": email, "text": text }, function(data){ if (data != "1") { $("#records_list").fadeOut(1000, function () { $(this).html(data); $(this).fadeIn(1000); }); } else { $("#warning2").fadeIn(2000, function () { $(this).fadeOut(2000); }); } }); } else { $("#warning1").fadeIn(2000, function () { $(this).fadeOut(2000); }); } };

Ваше имя:
Ваш email:
Отзыв:
Заполните все обязательные поля Вы не можете размещать более одного отзыва в течении 10 минут (защита от спама)