Гостевая книга. Гостевая книга Joomla — Phoca Guestbook

A guest book can be a great way for your website visitors to make a permanent impression on their presence on your website without being too intrusive. Before you start thinking about the HTML source for a guestbook, you need to decide how you want it to flow and how you want it look. In this case we will look at a guestbook that places a form for users to sign at the top. Below that there will then be a list of all the comments posted by the readers.

The HTML Source Code

The HTML source for our guestbook will consist of a web form and a list of DIV containers which will hold the display for the signed comments. The Part of the code that will handle the form is a simple as this.

Please Sign Our Guestbook

Right below the form, we will place the comments for other users that have already signed the guestbook and that HTML that handles this looks somewhat like this.

Love your website, I will come back often!!

It was a great experience spending time here, Would love to contribute more!!

Wilbur Right

Great to be a part of what you are doing here!!

Adam Adeve

Wish you all the best and success in your project!

Tony Scott

Keep up the good work!!

The effects of placing these two pieces of HTML code on your Guestbook webpage would be as illustrated in the image shown above on the left.

Making It All Work

As is the custom with HTML, it is not too functional on its own as HTML was designed primarily as a way to handle displays of text and images. To solve this problem, we need to implement some server-side code to process the data collected by the guestbook form. This server-side code could be in any one of a number of programming languages such as PHP, ASP .NET, JSP, or Ruby. Since programming in these languages is beyond the scope of this article, I’m going to use generic, "pseudo" code to represent the server side code and give you an idea of how it might look.

connect to database

if(form submitted){

insert data into database()

read all guestbook entries from database and order by date descending

while(database entries exist){

// display entires in this format

print: "

$fullname$
$date$

$message$

."

close connection to database

The pseudo code above simply makes a connection to the database where the data is stored. It then checks to see if the guestbook form has been submitted. If it has, it then enters the data into the database.

The next thing the pseudo code does is read all the guestbook entries from the database and display them to the user right under the web form giving the result as seen in the image above.

Conclusion

There you have it. The HTML source for a guestbook does not get any simpler than that. Guestbooks are one of the easiest and most basic dynamic pages you will ever implement on your website. Of course the guestbook can be styled further and more complex modes of operation and data validation can and should be used to suite the flow of your website. Whichever way you choose to implement the guestbook, the basics as described in the pseudo code remain the same.

Сегодня я дам Вам скрипт гостевой книги на PHP , ведь не секрет, что вещь эта достаточно популярная и если другой возможности общаться с администрацией нет, то гостевая книга просто необходима. И в этой статье Вы сможете скачать скрипт гостевой книги на PHP , а также я расскажу о процессе его установки.

Очень часто люди просят скрипт гостевой книги на html, либо на javascript . Увы, такого никогда нет и не будет, так как для работы гостевой книги необходимо хотя бы записывать сообщения в файл. А это сделать ни в JavaScript , ни, тем более, в HTML невозможно.

Теперь копируйте папку guest в корень своего сайта. Далее располагайте на странице своего сайта ссылку на гостевую книгу (http://ваш_сайт/guest ).

Следующим шагом будет настройка гостевой книги. Для этого зайдите по адресу http://ваш_сайт/guest/admin.php . Введите пароль "admin " и после успешной авторизации зайдите во вкладку "Конфигурирование ". Краткое описание всех настроек:

  • Имя скрипта - поставьте свой название для гостевой книги Вашего сайта.
  • Текст приветствия - напишите любой текст, которые Вы хотите, чтобы видели Ваши посетители при посещении гостевой книги.
  • Рекламный блок - если Вы хотите разместить рекламу в гостевой книги, то скопируйте в это поле её код. Если её нет, то оставьте это поле пустым.
  • Ссылка на главную сайта - поставьте ссылку на главную страницу своего сайта.
  • Емайл админа / отсылать сообщения - укажите свой e-mail , а также выберите: хотите Вы получать сообщения на свою почту или нет.
  • Пароль админа - обязательно поставьте свой пароль. Не оставляйте "admin ".
  • Включить МОДЕРИРОВАНИЕ сообщений? - если Вы хотите проверять каждое сообщение перед публикацией, то включите данную опцию.
  • Задействовать функцию АНТИСПАМ? - здесь можно отключить систему защиты от спама, либо выбрать один из трёх вариантов: обычная капча, загадка или матоперация. Если Вы выберите обычную цифровую капчу, то укажите также длину капчи в текстовом поле справа.
  • Задействовать функцию АНТИФЛУД? - данная опция позволяет отфильтровать сообщения не по теме.
  • Делать ссылки в тексте активными? - если поставите "Да ", то тогда ссылки в тексте собщений будут активными. Это удобно для пользователей, но Ваша гостевая книга будет хорошим местом для спамера.
  • Включить / отключить графические смайлы? - если поставите "Да ", то пользователь сможет использовать смайлики.
  • Макс. длина имени - допустимое количество символов в имени пользователя.
  • Макс. длина сообщения - допустимое количество символов в сообщении.
  • Сообщений на страницу - количество выводимых сообщений на одной странице.
  • Следование сообщений - сортировка по возрастанию или убыванию даты написания сообщения.
  • Скин - внешний вид.

На самом деле, существует огромное количество самых разнообразных скриптов гостевых книг . И когда я искал его, то перебрал не меньше двух десятков и остановился на этом по следующим причинам.

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.

1. На бесплатном хостинге есть только то, что дают.
2. Лучше, но совсем не обязательно. Порядочный гость оставит сообщение так как нужно (через мою форму), а хороший хакер все равно обойдет ваши $_GET, $_POST, $_COOKIE и $HTTP_REFERER тоже.
3. Контроль длины производиться, но только неявно, самой БД (единственно, что только само сообщение может быть огромно - до 64Кб).
4. Да, есть, HtmlSpecialChars была использована, не использовал AddSlashes (и это большая ошибка, признаю свою вину, см. ниже). При в ключеной magic_quotes_gpc, данная проблема не столь остра, но дыра в безопасности остается (в панели управления).
5. Да, согласен, можно было бы и вырезать, но имя #$@%#$^%$ ничем не хуже чем AF4ETX09T43 . В e-mail и url есть дырка, можно использовать скрипты.
6. Интересно, что не неинициализировано?

Есть еще ряд интересных приемов, как например защита от автоматического ввода через картинку (как на этом сайте) http://www.сайт/webmast/php/Security-Images-in-PHP/
...

Картинок кажется небыло, зачем усложнять демонстрационный пример. Пока ни разу не встречал гостевой с подобной защитой. Что касается этого сайта, то это не гостевая.

Анатомия межсайтового скриптинга XSS
http://www.woweb.ru/index.htm/id/1073393942

Очень интересно, спасибо.

З.Ы. Если бы Аффтор потрудился бы почитать (и вниктуть) в статьи что на этом же сайте, то понял бы, на сколько его труд непрофессионален. Стоит учитывать опыт предыдущих Авторов и, по крайней мере, уважать их труды - они же для вас писали.

Где есть не уважение? Извините если кого обидел.

Что касается защиты, то советую еще раз прочесть первый абзац статьи, я не ставил цели расматривать надежную гостевую, а лишь показать как можно написать протейшую гостевую, для тех кто только начинает познавать CGI, ведь не все сразу приходит, надо начинать с простого, и ты тоже не сразу стал таким умным, тоже совершал ошибки, так что давай оставим аспекты защиты другим статьям, другим авторам.

Да, с точки зрения защиты этот скрипт непрофессионален, и я непрофесионал в области защиты, поэтому в первом абзаце и стоит соответвующая оговорка, которую, к сожалению не все прочли.

PS

Цитата:

Закон "Об авторском праве и смежных правах"
Статья 6. Объект авторского права. Общие положения
1. Авторское право распространяется на произведения науки, литературы и искусства, являющиеся результатом творческой деятельности, независимо от назначения и достоинства произведения, а также от способа его выражения.
Остальное можешь прочесть тут: http://www.febras.ru/~patent/copyright/2_3part2.html
В том числе и Статья 9. п.1
И не тебе решать пользоваться мне моим правом или нет.



Full Name:
Email Address
Message: