Hudzilla.org - the homepage of Paul Hudson
Contents > Practical PHP Wish List | Report Bug | About Me ]

22.2     Creating a guestbook

This is NOT the latest copy of this book; click here for the latest version.

The next task up the difficulty food chain is creating a guestbook - a textual log of messages from visitors to your site. Programmatically speaking, guestbooks are actually easier than polls to write because you need only store a chunk of user text directly in your database. The reason I have covered polls first is because guestbooks are inherently insecure - when you just allow users to click a button to select their entry there is little scope for error, but when you take their input and need to use that for text entry into your database, you become a much juicier target.

Guestbooks are usually most common on personal homepages of any size, but are generally not appropriate for corporate sites as you may get abusive users posting there. Do not believe me? Consider this: I once created a Prayer Board for a local church, which was effectively a guestbook, and even that had a number of abusive messages posted there by people who clearly have a lot of time on your hands.

We'll be looking at this and other security concerns related to guestbooks here.





<< 22.1.7 Building a better poll   22.2.1 Analysis >>
Table of Contents
Want to see this stuff in print? PHP in a Nutshell takes the core topics covered here, adds in thousands of edits from the editorial team and myself, and combines them to make an unbeatable reference for PHP programmers at all levels.



My latest book has hundreds more tips on how to use PHP, Apache, and MySQL, plus Perl, Python, shell scripts, performance tuning, and more!



Top-right shadow
 
Bottom-left shadow Bottom shadow

Comments from other readers
A PHP User - 29 Aug 2008

Agha Dilbar(deserves for the noble peace prize) see our message in internet search Key Word: No-1 aghadilbar No-2 aghadilbar2 No-3 aghadilbar3 E-mail aghadilbar3@yahoo.com Postal address:IRM(NGO)64-neelum,ait,Lahore,pakistan Location: Lahore, Pakistan,Phone No 0092427830084 Topic: Peace Comments Change the World with Peace and Prosperity 10-Million Urgent Peace letters to Head of States, UN, Parliaments, Political Parties, TV News Channels, International Newspapers, Magazines, Universities, Think tanks, Amnesty International , Welfare NGOs and Govt Contacts, all over the World Subject: Friendship, Progress and Prosperity for peace throughout the World I Agha Dilbar Founder International Revolution Movement have sent10-Million research Peace Letters to International Community from 11-September 2001(9/11) till today about War on Terror. ********Our NGO International Revolution Movement (IRM) has 3-Principles, Friendship, Progress and Prosperity all over the World. Our NGO, s programmed is for The Welfare of International Community and to save the Human Being from 3rd World War and World Terrorism. I Agha Dilbar have a Great Peace Plan for Kashmir, Afghanistan, Chechnya, Middle East, Iraq , iran and Pakistan to stop and eliminate Suicidal Bomb Attacks and State Terrorism, all over The World. Some Powerful Underground Groups want to begin 3rd World War for their worst intentions.(To occupie the oil resouries of underdevelop and weak coundries of the world) World should remember that religion Islam is a religion of Peace Security, Fraternity and Love. We Muslims are not concerned with any sort of Terrorism; Terrorists are only using the name of Islam. Likewise people using the name of Islam to pretence are not Muslims. They are only Terrorists. I, Agha Dilbar on emergency ground want to present solid suggestions to International Community, regarding their policies on War against Terrorism, Can be saved from Economic Crisis, I should be given a chance to make Open Speech and Dialogue, on the leading TV News Channels to eliminate Poverty, Unemployment and Lawlessness(Sueside Bombing and State Terrorism) at Internation

aghadilbar - 29 Aug 2008

Name: Agha Dilbar(deserves for the noble peace prize)
see our message in internet search
Key Word: No-1 aghadilbar No-2 aghadilbar2 No-3 aghadilbar3
E-mail aghadilbar3@yahoo.com
Location: Lahore, Pakistan
Topic: Peace Comments Change the World with Peace and Prosperity 10-Million Urgent Peace letters to Head of States, UN, Parliaments, Political Parties, TV News Channels, International Newspapers, Magazines, Universities, Think tanks, Amnesty International and Welfare NGOs, all over the World Subject: Friendship, Progress and Prosperity for peace throughout the World I Agha Dilbar Founder International Revolution Movement have sent10-Million research Peace Letters to International Community from 11-September 2001(9/11) till today about War on Terror. Our NGO International Revolution Movement (IRM) has 3-Principles, Friendship, Progress and Prosperity all over the World. Our NGO, s programmed is for The Welfare of International Community and to save the Human Being from 3rd World War and World Terrorism. I Agha Dilbar have a Great Peace Plan for Kashmir, Afghanistan, Chechnya, Middle East, Iraq and iran to stop and eliminate Suicidal Bomb Attacks and State Terrorism, all over The World. Some Powerful Underground Groups want to begin 3rd World War for their worst intentions.(To occupie the oil resouries of underdelop and weak coundries of the world) World should remember that religion Islam is a religion of Peace Security, Fraternity and Love. We Muslims are not concerned with any sort of Terrorism; Terrorists are only using the name of Islam. Likewise people using the name of Islam to pretence are not Muslims. They are only Terrorists. I, Agha Dilbar on emergency ground want to present solid suggestions to International Community, regarding their policies on War against Terrorism, Can be saved from Economic Crisis, I should be given a chance to make Open Speech and Dialogue, on the leading TV News Channels to eliminate Poverty, Unemployment and Lawlessness at International level. I am warning the International Community that according to my previous Research spread over a period of 6-years; it is evident th

gary.orsak@kbr.com - 29 Aug 2008

raghead muslims need to kiss my @ss.

anyway if you want to swap pics email me: gary.orsak@kbr.com

normadsen@gmail.com - 29 Aug 2008

Thank's the site owners.
<a href=http://megabrand.ind.in/adipex/>adipex</a>
<a href=http://megabrand.ind.in/ambien/>ambien</a>
<a href=http://megabrand.ind.in/ativan/>ativan</a>
<a href=http://megabrand.ind.in/carisoprodol/>carisoprodol</a>
<a href=http://megabrand.ind.in/cialis/>cialis</a>
<a href=http://megabrand.ind.in/diazepam/>diazepam</a>
<a href=http://megabrand.ind.in/didrex/>didrex</a>
<a href=http://megabrand.ind.in/fioricet/>fioricet</a>
<a href=http://megabrand.ind.in/hydrocodone/>hydrocodone</a>
<a href=http://megabrand.ind.in/levitra/>levitra</a>
<a href=http://megabrand.ind.in/lortab/>lortab</a>
<a href=http://megabrand.ind.in/online-pharmacy/>online pharmacy</a>
<a href=http://megabrand.ind.in/paxil/>paxil</a>
<a href=http://megabrand.ind.in/phentermine/>phentermine</a>
<a href=http://megabrand.ind.in/propecia/>propecia</a>
<a href=http://megabrand.ind.in/soma/>soma</a>
<a href=http://megabrand.ind.in/tenuate/>tenuate</a>
<a href=http://megabrand.ind.in/tramadol/>tramadol</a>
<a href=http://megabrand.ind.in/ultram/>ultram</a>
<a href=http://megabrand.ind.in/valium/>valium</a>
<a href=http://megabrand.ind.in/valtrex/>valtrex</a>
<a href=http://megabrand.ind.in/viagra/>viagra</a>
<a href=http://megabrand.ind.in/vicodin/>vicodin</a>
<a href=http://megabrand.ind.in/xanax/>xanax</a>
<a href=http://megabrand.ind.in/xenical/>xenical</a>

MGBADA JOE - 29 Aug 2008

I LOVE THIS PAGE. KEEP UP THE GOOD WORK.

uche imo - 29 Aug 2008

kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkeep or of imo@yahoo.com

aghadilbar3@yahoo.com - 29 Aug 2008

Name: Agha Dilbar(deserves for the noble peace prize)

Website:No-1 aghadilbar No-2 aghadilbar2

E-mail aghadilbar3@yahoo.com

Location: Lahore, Pakistan

Topic: Peace Comments Change the World with Peace and Prosperity 10-Million Urgent Peace letters to Head of States, UN, Parliaments, Political Parties, TV News Channels, International Newspapers, Magazines, Universities, Think tanks, Amnesty International and Welfare NGOs, all over the World Subject: Friendship, Progress and Prosperity for peace throughout the World I Agha Dilbar Founder International Revolution Movement have sent10-Million research Peace Letters to International Community from 11-September 2001(9/11) till today about War on Terror. Our NGO International Revolution Movement (IRM) has 3-Principles, Friendship, Progress and Prosperity all over the World. Our NGO, s programmed is for The Welfare of International Community and to save the Human Being from 3rd World War and World Terrorism. I Agha Dilbar have a Great Peace Plan for Kashmir, Afghanistan, Chechnya, Middle East and Iraq to stop and eliminate Suicidal Bomb Attacks and State Terrorism, all over The World. Some Powerful Underground Groups want to begin 3rd World War for their worst intentions. World should remember that religion Islam is a religion of Peace Security, Fraternity and Love. We Muslims are not concerned with any sort of Terrorism; Terrorists are only using the name of Islam. Likewise people using the name of Islam to pretence are not Muslims. They are only Terrorists. I, Agha Dilbar on emergency ground want to present solid suggestions to International Community, regarding their policies on War against Terrorism, Can be saved from Economic Crisis, I should be given a chance to make Open Speech and Dialogue, on the leading TV News Channels to eliminate Poverty, Unemployment and Lawlessness at International level. I am warning the International Community that according to my previous Research spread over a period of 5-years; it is evident that sufficient Intentional or Unintentional efforts have not been made to eradicate The Root Causes of Terrorism in all its forms

Karachi Stock Exchange - 29 Aug 2008

Complete Guide for Stock Exchange Broker and Members. Get Live Coverage and Share Indexing, Company Rating and Demand. High and Low Scoring, all at Karachi Stock.
www.karachistock.info

Bola - 29 Aug 2008

I've probably done this before but i just want to thank you for putting your book online. I am totally new to PHP but your book is part of the resources helping me learn PHP. Though my progress is slow. It is sure.

aghadilbar2@yahoo.com - 29 Aug 2008

Name: Agha Dilbar

Website:No-1 aghadilbar No-2 aghadilbar2

E-mail aghadilbar2@hotmail.com

Location: Lahore, Pakistan

Topic: Peace Comments Change the World with Peace and Prosperity 10-Million Urgent Peace letters to Head of States, UN, Parliaments, Political Parties, TV News Channels, International Newspapers, Magazines, Universities, Think tanks, Amnesty International and Welfare NGOs, all over the World Subject: Friendship, Progress and Prosperity for peace throughout the World I Agha Dilbar Founder International Revolution Movement have sent10-Million research Peace Letters to International Community from 11-September 2001(9/11) till today about War on Terror. Our NGO International Revolution Movement (IRM) has 3-Principles, Friendship, Progress and Prosperity all over the World. Our NGO, s programmed is for The Welfare of International Community and to save the Human Being from 3rd World War and World Terrorism. I Agha Dilbar have a Great Peace Plan for Kashmir, Afghanistan, Chechnya, Middle East and Iraq to stop and eliminate Suicidal Bomb Attacks all over The World. Some Powerful Underground Groups want to begin 3rd World War for their worst intentions. World should remember that religion Islam is a religion of Peace Security, Fraternity and Love. We Muslims are not concerned with any sort of Terrorism; Terrorists are only using the name of Islam. Likewise people using the name of Islam to pretence are not Muslims. They are only Terrorists. I, Agha Dilbar on emergency ground want to present solid suggestions to International Community, regarding their policies on War against Terrorism, Can be saved from Economic Crisis, I should be given a chance to make Open Speech and Dialogue, on the leading TV News Channels to eliminate Poverty, Unemployment and Lawlessness at International level. I am warning the International Community that according to my previous Research spread over a period of 4-years; it is evident that sufficient Intentional or Unintentional efforts have not been made to eradicate The Root Causes of Terrorism in all its forms and manifestations (Suicide Bombing and Destructive Ten

aghadilbar2@yahoo.com - 29 Aug 2008

Name: Agha Dilbar

Website:No-1 aghadilbar No-2 aghadilbar2

E-mail aghadilbar2@hotmail.com

Location: Lahore, Pakistan

Topic: Peace Comments Change the World with Peace and Prosperity 10-Million Urgent Peace letters to Head of States, UN, Parliaments, Political Parties, TV News Channels, International Newspapers, Magazines, Universities, Think tanks, Amnesty International and Welfare NGOs, all over the World Subject: Friendship, Progress and Prosperity for peace throughout the World I Agha Dilbar Founder International Revolution Movement have sent10-Million research Peace Letters to International Community from 11-September 2001(9/11) till today about War on Terror. Our NGO International Revolution Movement (IRM) has 3-Principles, Friendship, Progress and Prosperity all over the World. Our NGO, s programmed is for The Welfare of International Community and to save the Human Being from 3rd World War and World Terrorism. I Agha Dilbar have a Great Peace Plan for Kashmir, Afghanistan, Chechnya, Middle East and Iraq to stop and eliminate Suicidal Bomb Attacks all over The World. Some Powerful Underground Groups want to begin 3rd World War for their worst intentions. World should remember that religion Islam is a religion of Peace Security, Fraternity and Love. We Muslims are not concerned with any sort of Terrorism; Terrorists are only using the name of Islam. Likewise people using the name of Islam to pretence are not Muslims. They are only Terrorists. I, Agha Dilbar on emergency ground want to present solid suggestions to International Community, regarding their policies on War against Terrorism, Can be saved from Economic Crisis, I should be given a chance to make Open Speech and Dialogue, on the leading TV News Channels to eliminate Poverty, Unemployment and Lawlessness at International level. I am warning the International Community that according to my previous Research spread over a period of 4-years; it is evident that sufficient Intentional or Unintentional efforts have not been made to eradicate The Root Causes of Terrorism in all its forms and manifestations (Suicide Bombing and Destructive Ten

aghadilbar - 29 Aug 2008

Name: Agha Dilbar
Website:no-1aghadilbar no -2 aghadilbar2
E-mail aghadilbar2@hotmail.com
Location: Lahore, Pakistan
Topic: Peace Comments Change the World with Peace and Prosperity 10-Million Urgent Peace letters to Head of States, UN, Parliaments, Political Parties, TV News Channels, International Newspapers, Magazines, Universities, Think tanks, Amnesty International and Welfare NGO’s, all over the World Subject: Friendship, Progress and Prosperity for peace throughout the World I Agha Dilbar Founder International Revolution Movement have sent10-Million research Peace Letters to International Community from 11-September 2001(9/11) till today about War on Terror. Our NGO International Revolution Movement (IRM) has 3-Principles, Friendship, Progress and Prosperity all over the World. Our NGO’ s programmed is for The Welfare of International Community and to save the Human Being from 3rd World War and World Terrorism. I Agha Dilbar have a Great Peace Plan for Kashmir, Afghanistan, Chechnya, Middle East and Iraq to stop and eliminate Suicidal Bomb Attacks all over The World. Some Powerful Underground Groups want to begin 3rd World War for their worst intentions. World should remember that religion Islam is a religion of Peace Security, Fraternity and Love. We Muslims are not concerned with any sort of Terrorism; Terrorists are only using the name of Islam. Likewise people using the name of Islam to pretence are not Muslims. They are only Terrorists. I, Agha Dilbar on emergency ground want to present solid suggestions to International Community, regarding their policies on War against Terrorism, Can be saved from Economic Crisis, I should be given a chance to make Open Speech and Dialogue, on the leading TV News Channels to eliminate Poverty, Unemployment and Lawlessness at International level. I am warning the International Community that according to my previous Research spread over a period of 4-years; it is evident that sufficient Intentional or Unintentional efforts have not been made to eradicate The Root Causes of Terrorism in all its forms and manifestations (Suicide Bombing and Destructive Tendencie

aghadilbar - 29 Aug 2008

Name: Agha Dilbar
Website:no-1aghadilbar no -2 aghadilbar2
E-mail aghadilbar2@hotmail.com
Location: Lahore, Pakistan
Topic: Peace Comments Change the World with Peace and Prosperity 10-Million Urgent Peace letters to Head of States, UN, Parliaments, Political Parties, TV News Channels, International Newspapers, Magazines, Universities, Think tanks, Amnesty International and Welfare NGO’s, all over the World Subject: Friendship, Progress and Prosperity for peace throughout the World I Agha Dilbar Founder International Revolution Movement have sent10-Million research Peace Letters to International Community from 11-September 2001(9/11) till today about War on Terror. Our NGO International Revolution Movement (IRM) has 3-Principles, Friendship, Progress and Prosperity all over the World. Our NGO’ s programmed is for The Welfare of International Community and to save the Human Being from 3rd World War and World Terrorism. I Agha Dilbar have a Great Peace Plan for Kashmir, Afghanistan, Chechnya, Middle East and Iraq to stop and eliminate Suicidal Bomb Attacks all over The World. Some Powerful Underground Groups want to begin 3rd World War for their worst intentions. World should remember that religion Islam is a religion of Peace Security, Fraternity and Love. We Muslims are not concerned with any sort of Terrorism; Terrorists are only using the name of Islam. Likewise people using the name of Islam to pretence are not Muslims. They are only Terrorists. I, Agha Dilbar on emergency ground want to present solid suggestions to International Community, regarding their policies on War against Terrorism, Can be saved from Economic Crisis, I should be given a chance to make Open Speech and Dialogue, on the leading TV News Channels to eliminate Poverty, Unemployment and Lawlessness at International level. I am warning the International Community that according to my previous Research spread over a period of 4-years; it is evident that sufficient Intentional or Unintentional efforts have not been made to eradicate The Root Causes of Terrorism in all its forms and manifestations (Suicide Bombing and Destructive Tendencie

aghadilbar2@hotmail.com - 29 Aug 2008

Name: Agha Dilbar
Website:no-1aghadilbar no -2 aghadilbar2
E-mail aghadilbar2@hotmail.com
Location: Lahore, Pakistan
Topic: Peace Comments Change the World with Peace and Prosperity 10-Million Urgent Peace letters to Head of States, UN, Parliaments, Political Parties, TV News Channels, International Newspapers, Magazines, Universities, Think tanks, Amnesty International and Welfare NGO’s, all over the World Subject: Friendship, Progress and Prosperity for peace throughout the World I Agha Dilbar Founder International Revolution Movement have sent10-Million research Peace Letters to International Community from 11-September 2001(9/11) till today about War on Terror. Our NGO International Revolution Movement (IRM) has 3-Principles, Friendship, Progress and Prosperity all over the World. Our NGO’ s programmed is for The Welfare of International Community and to save the Human Being from 3rd World War and World Terrorism. I Agha Dilbar have a Great Peace Plan for Kashmir, Afghanistan, Chechnya, Middle East and Iraq to stop and eliminate Suicidal Bomb Attacks all over The World. Some Powerful Underground Groups want to begin 3rd World War for their worst intentions. World should remember that religion Islam is a religion of Peace Security, Fraternity and Love. We Muslims are not concerned with any sort of Terrorism; Terrorists are only using the name of Islam. Likewise people using the name of Islam to pretence are not Muslims. They are only Terrorists.

aghadilbar2@hotmail.com - 29 Aug 2008

Name: Agha Dilbar
website:no-1 aghadilbar no-2 aghadilbar2
E-mail aghadilbar2@hotmail.com
Location: Lahore, Pakistan
Topic: Peace Comments Change the World with Peace and Prosperity 10-Million Urgent Peace letters to Head of States, UN, Parliaments, Political Parties, TV News Channels, International Newspapers, Magazines, Universities, Think tanks, Amnesty International and Welfare NGO’s, all over the World Subject: Friendship, Progress and Prosperity for peace throughout the World I Agha Dilbar Founder International Revolution Movement have sent10-Million research Peace Letters to International Community from 11-September 2001(9/11) till today about War on Terror. Our NGO International Revolution Movement (IRM) has 3-Principles, Friendship, Progress and Prosperity all over the World. Our NGO’ s programmed is for The Welfare of International Community and to save the Human Being from 3rd World War and World Terrorism. I Agha Dilbar have a Great Peace Plan for Kashmir, Afghanistan, Chechnya, Middle East and Iraq to stop and eliminate Suicidal Bomb Attacks all over The World. Some Powerful Underground Groups want to begin 3rd World War for their worst intentions. World should remember that religion Islam is a religion of Peace Security, Fraternity and Love. We Muslims are not concerned with any sort of Terrorism; Terrorists are only using the name of Islam. Likewise people using the name of Islam to pretence are not Muslims. They are only Terrorists. I, Agha Dilbar on emergency ground want to present solid suggestions to International Community, regarding their policies on War against Terrorism, Can be saved from Economic Crisis, I should be given a chance to make Open Speech and Dialogue, on the leading TV News Channels to eliminate Poverty, Unemployment and Lawlessness at International level. I am warning the International Community that according to my previous Research spread over a period of 4-years; it is evident that sufficient Intentional or Unintentional efforts have not been made to eradicate The Root Causes of Terrorism in all its forms and manifestations (Suicide Bombing and Destructive Tendencie



Add comment
Please note that by posting a comment here you are committing it to the public domain. This is important so that others can make use of your code themselves, and also so that I can incorporate helpful notes directly into the main text. Comments are limited to 2000 characters in length.

If you are reporting an error in the content, please tell me directly.

Your name/email address:
Your comment:
 
Now, in order to verify that you're a real person, please answer this simple question: what is ten plus three?
The answer is:
(please write in
numbers, eg 19)


Top-right shadow
 
Bottom-left shadow Bottom shadow