» » @lexguestbook

@lexguestbook- it's free PHP guestbook website script. Written in PHP language, @lexguestbook Easy to install in minutes, even beginners will find it easy to figure it out.

PHP guestbook completely free script - the main condition: do not remove the copyright at the bottom of the page. PHP guestbook is installed on your server and is completely independent of any other sites. Back up the message in PHP guestbook as you wish, at least every day. Automatic installation Alex Guestbook: The names of the tables in the database are registered by themselves.

Benefits of the script

  • Thanks to skins, you can change the look @lexguestbook for the design of your site. (all skins are valid XHTML 1.0 Transitional)
  • IN PHP guestbook built-in about 20 languages.
  • Each country displays its own flag.
  • Support for emoticons: the ability to add your own emoticons, delete, edit.
  • Character statistics are displayed: you can set the maximum number of letters in one message.
  • Internal search engine.
  • Possibility of evaluation by visitors. Evaluation on a 10-point system.

Supported languages

Full translation.
French, English, Polish, German, Norwegian, Italian, Dutch, Slovak, Persian, Turkish.

Partial translation. Some words are still in English.
Spanish, Russian, Swedish, Czech, Croatian, Portuguese, Icelandic, Serbian, Danish.

» DRBGuestbook

The DRBGuestbook is a free, simple PHP script that does not require a MySql database. Despite this, you can manage the program, delete messages, approve messages, ban users by IP address, through a password-protected admin panel. The script also includes anti-spam checks such as image verification, URL blocking, and moderation of all messages in the book. You can set the feature so that every time someone leaves a message, you will be notified by e-mail.

Benefits of the script

  • Quick and easy installation.
  • Does not require a MySQL database. All messages are stored in a file.
  • You can delete multiple messages at once.
  • Contains anti-spam check.
  • You can ban the IP address so that you can not leave messages.
  • Supports post moderation so that only approved posts are published.
  • Get notified by email every time someone subscribes to your guestbook.
  • Checking the message: a list of "forbidden" (swear words) for publication.
  • Anti-flood function. To prevent users from posting so often.
  • The script prevents the publication of HTML codes or links (URL) in the message body, as an anti-spam precaution.
  • Setting the minimum and maximum letters in one message.
  • The script can be easily configured: error messages, warnings, date and time.
  • Date and timezone are easily configurable.
  • The generated pages contain XHTML syntax and work fine in IE and Firefox browsers.
  • Login to the admin panel through the web interface.

System requirements

  • PHP version 4.4 or higher
  • GD library
  • Apache HTTP Server with .htaccess file with Override Allowed feature (recommended)
  • Linux, Windows, Unix, Mac OSX, Sun Solaris, IIS

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 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.
    • Profit 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.

Creating a guest book on the site

In previous articles, the creation of a feedback form on the site was considered. Another option for two-way communication with visitors is Guest book, in which visitors leave messages directly on the site page. The site administrator can reply to them, edit, delete, etc. Guest book with its undoubted advantages over the feedback form, it has one big drawback - it adds worries to the administrator. Now all visitors' messages are visible on the site and sometimes you need to respond to them. In addition, our guests write not only grateful reviews, but also all sorts of indecent things, and they do this with special zeal. Kill these "writers"! Therefore, the guest book must be constantly monitored and educated as hooligans-loafers. An example of a guest book is shown in Figure 1:



Fig.1. One of the guestbook options

There are many options for guest books, paid and free, on the Internet. Sometimes a guest book is included in the list of services provided by hosting. In this case, you just need to place a link to the guest book on your site page and, if desired, customize its interface through the control panel. One trouble - when you change hosting, you will lose the guest book. So it's better to have your own, especially since installing it on the site is as easy as two or two.

Guestbooks can be built with or without databases. In the latter case, the information is stored in a regular file. If you are a supporter of simple solutions, then I recommend the second option, that is, to do without creating a database. I liked the guest book developed by Sergey Shestopalov (see his site "Home Scripts"). The site also offers interesting authorings for interactive communication with visitors: forums, guest books, various forms for comments, sending messages, collecting statistics and many other useful things. Be sure to check it out, I recommend it!

For example, consider setting Guest book version 2.0. It provides the following features:

  • message management: deleting, editing, commenting,
  • setup and all work is done through the control panel, that is, you do not need programming knowledge and other intricacies,
  • emoticons, text and color formatting are supported in messages,
  • message preview,
  • there is an Antispam system, Antihacker, blocking users by ip, searching for an intruder by ip,
  • ad protection and security are organized using captcha (input of distorted numbers). You can also make a "black list" of unwanted visitors and a list of prohibited words,
  • fully customizable interface and much more.

Guestbook 2.0 despite its simplicity, it is quite sufficient for most applications. You can download it for free from the corresponding page of Sergey Shestopalov's website. The size of the folder with files after unpacking (name - Book) about 400 Kb.

Let's start installing a guest book on your site:

1. First you need to check that your hosting plan (the office where your site is hosted) supports PHP. If not, then you will most likely have to pay extra to switch to another tariff that supports PHP.

2. Uploading a folder Book to your site, usually in the root directory, through the control panel or via FTP .

3. We put on the necessary page of the site a hyperlink to the guest book - http://www.your_site /book/index.php.

4. It is also advisable to check the permissions for files and folders on your site. The easiest way to do this is through the control panel. Near each folder and file there are icons like rwx, r-x or numbers 755, 644, etc. They just designate access rights for the administrator and guests of the site:
r(or 4) - the right to read data from the file,
w(or 2) - the right to change the contents of the file,
x(or 1) - the right to execute the file.

Digital coding is used to shorten the recording. For example, 7 is equivalent to rwx (4+2+1), and so on. Without going into the details of these abbreviations, since they are usually deciphered in the site control panel manual, check that you have 755 for folders (which corresponds to rwx, r-x, r-x), and for files 644 (rw-, r--, r--). Usually these values ​​​​are set by default and you do not have to change anything, but it's better to check anyway. As they say, "my neighbor is my friend, but it's better to hide the fat."

That's all! Go to your site, open the page on which you have placed a link to the guest book, follow this link and leave the first message to your loved one.

Now a few words about the maintenance of the guest book. The administrator's session with the guest book begins with authorization - entering the control panel at http://www.your_site/book/admin/index.php. Login and password for the first login admin 111.

Then you can change the password (it is desirable to do this) and start editing posts and replying to them. The interface of the admin panel is extremely friendly and you will easily understand all the functions. All tools are clear and additionally provided with tips. For example, Fig. 2 shows the panel for setting the appearance of the main page of the guest book and lists the available panels:



Fig.2.

Of course, in exactly the same way as described, you can install a more complete version Guest book 3.2 Sergey Shestopalov, which has some additional features: a statistics module, the ability to check messages by the administrator before publishing on the site (moderation), and some others.

As I said, on the pages guest book different unwanted "friends" like to leave their messages. Usually they post links to their sites here, hiding behind rave reviews about your site. 99% of the time it's spam. Therefore, I recommend that you exclude entering the site address in messages. To do this, enter the guestbook control panel and on the tab Appearance - Shape uncheck "Site" to prevent spammers from using the guest book to post links to their sites. It is better to leave e-mail and ICQ, because sometimes people want to receive a confidential answer, that is, without posting in the guest book. Don't forget to click the "Save" button at the bottom of the page when you're done.

Removing the "Site" item doesn't always help against guestbook clogging and it's best to check posts before posting them. By the way, if there are few messages, then you can simplify the guest book to a regular HTML page. This simplest option is described in

I recently received an email asking for help with a guestbook or guestbook script. Therefore, I fulfill my promise and today's article will be on this topic.

What is a guest book and why is it needed on the site at all?

A guest book is a kind of a book of complaints or wishes, where any visitor to your site can leave a message, which (if approved by the admin) can be read by everyone. Those. these are the most common comments, but not to a separate note, but to the whole site!

A guestbook adds interactivity to your site and is a common form of feedback.

So, for starters, let's create a table in the mysql database, where all user comments will be stored:

CREATE TABLE IF NOT EXISTS `guestbook` (`id` int(11) NOT NULL auto_increment, `user_ip` int(10) unsigned NOT NULL, `user_email` varchar(50) NOT NULL, `addtime` int(11) NOT NULL , `name` varchar(15) NOT NULL, `text` text NOT NULL, `admin_text` text NOT NULL, `image` varchar(40) NOT NULL, `sex` tinyint(1) NOT NULL default "1", PRIMARY KEY (`id`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

  • id — message sequence number
  • user_ip - the user's IP address, represented as an integer
  • user_email — user email address
  • addtime — time when the message was added
  • name - username
  • text — message text
  • admin_text - the text of the administrator's response to the message
  • image - user avatar
  • sex — user gender (male/female)

As you can see in the plate there is a field for the user's IP address. This is done so that you can then make a blacklist, where you can enter the IP addresses of "not good" users who will not be able to leave messages in the future.

The sex field is needed in order to display the “correct” avatar in case the user does not upload his own.

Done with the database. Let's move on to programming. Since we are working with a database, the first thing we will do is create the simplest class for working with a database. To do this, let's create a DB.class.php file and put the following code there:

Class DB ( private static $instance; private $MySQLi; private function __construct(array $dbOptions)( $this->MySQLi = @ new mysqli($dbOptions["db_host"],$dbOptions["db_user"], $dbOptions[ "db_pass"],$dbOptions["db_name"]); if (mysqli_connect_errno()) ( throw new Exception("Database error."); ) $this->MySQLi->set_charset("utf8"); ) public static function init(array $dbOptions)( if(self::$instance instanceof self)( return false; ) self::$instance = new self($dbOptions); ) public static function getMySQLiObject()( return self::$ instance->MySQLi; ) public static function query($q)( return self::$instance->MySQLi->query($q); ) public static function esc($str)( return self::$instance-> MySQLi->real_escape_string(htmlspecialchars($str)); ) )

It is worth saying that the constructor of this class is declared as private, so the object cannot be created outside the class, and initialization is only possible from the static init() method. It takes an array with MySQL connection parameters and creates an instance of the class, which is contained in the self::$instance static variable. This ensures that there is only one connection to the database at any given time.

The rest of the class performs database queries based on the static query() method.

If you wish, you can modify this class, as you need it!

Also, in the development of the guest book, we will need helper functions, which I will put in a separate file and call it helper.php.

Now we have smoothly approached the most important file in our script - index.php. It is here that all the logic of the script will be executed.

So, the first step is to initialize the session, set the basic settings and connect to the mysql database. The session will store the security code (captcha) of the form.

session_start(); /* Database configuration. Add your details */ $dbOptions = array("db_host" => "localhost", "db_user" => "", "db_pass" => "", "db_name" => ""); //Include the class to work with the database require "DB.class.php" //Include helper functions require "helper.php" // Connect to the database DB::init($dbOptions); $appath = realpath(dirname(__FILE__))."/"; //Folder on the server where avatars will be uploaded $uploaddir = "images/avatars"; //Maximum number of posts per page $per_page = 10; //Number of pages in paging $num_page = 2;

To build navigation through the pages in the guest book, you need to know the total number of messages. This can be done like this:

//Get the total number of messages $result = DB::query("SELECT COUNT(*) AS numrows FROM guestbook"); $total = $result->fetch_object()->numrows;

Now let's determine the page number to be shown. To do this, we will process the $_GET["p"] variable

$start_row = (!empty($_GET["p"]))? intval($_GET["p"]): 0; if($start_row< 0) $start_row = 0; if($start_row >$total) $start_row = $total;

$result = DB::query("SELECT * FROM guestbook ORDER BY addtime DESC LIMIT ".$start_row.",".$per_page); //The list of messages will be stored here $items = array(); while($row = $result->fetch_assoc())( $row["addtime"] = format_date($row["addtime"],"date")."|".format_date($row["addtime"] ,"time"); $items = $row; )

Here I have used the format_date() function to work with the date and time that I created in the helper.php file. Its main task is to display the date and time in Russian format. Here is her code:

Function format_date($date,$format = "date")( if(empty($date)) return ""; $months = array("1" => "January", "2" => "February", " 3" => "March", "4" => "April", "5" => "May", "6" => "June", "7" => "July", "8" => " August", "9" => "September", "10" => "October", "11" => "November", "12" => "December"); if($format == "time") ( return date("H:i",$date); ) elseif($format == "date")( $m = date("n", $date); $m = $months[$m]; $ d = date("j",$date); $y = date("Y",$date); return $d." ".$m." ".$y; ) else( return date("d.M.Y H :i",$date); ) )

This function has only 2 parameters:

  • $date - date in UNIX format (number of seconds elapsed since the night of January 1st, 1970)
  • $format - date output form.

Now we can list the posts on the page. For this I use the following html code:

Guest book

Reviews

leave feedback
">
">

There are currently no active reviews!

Here I used 2 new functions: show_avatar() and pagination() which I created and placed in helpers.php file

That's all! Good luck! Leave your feedback in the comments!