• home
  • forum
  • my
  • kt
  • download
  • Guestbook in 3 easy steps!

    Author: 2008-08-28 11:10:24 From:

    This tutorial will teach you how to create a basic guestbook by using PHP and MySQL. Your visitors will be able to leave comments on your website.


    Requirements:
    • Server with PHP/MySQL capabilities.
    • Minimal PHP/HTML knowledge.

    Step number 1: creating the database.


    If you know how to create a database, skip to step number 2.

    First of all you will need to create a database, the process is fairly simple.

    Databases contain tables and tables contain information.

    To do that you need to connect to the database administration tool. Personally, I recommend using phpMyAdmin - it is currently one of the most popular database management tools.

    Local servers: If you are using an web server pack (i.e. xampp), it will most likely be here: http://127.0.0.1/phpmyadmin/ If not, you will have to install it manually. You can get it at their website - http://www.phpmyadmin.net/

    Hosting services: Most hosting companies offer control panels for their clients (i.e. cPanel), you should find out how to access phpMyAdmin or a similar database management tool. You can do that by logging into your control panel. If you do not have one, look on your hosts website or ask them.

    Once you've logged into the whatever database management tool you'll be using, create a database called "guestbook".

    Step number 2: creating the table.


    As I mentioned previously, databases store tables and tables store information. There can be several tables in one database.

    Let's go on and start creating the table now. Name the table "messages" and make the number of columns 6, submit it. You should now see a form with 5 fields. Make them look like this:
    ID - INT - Extra: Increment Key - Primary Key
    Name - TEXT
    Date - DATETIME
    Message - TEXT
    IP - TEXT


    So with phpMyAdmin the form should look like this:
    Example #1

    If you everything is as is in the example, submit the form. Remember that everything should be in the same order.

    The structure of your table should now look like this. If you made a mistake, please go back.
    Example #2




    Step number 3: using the database.


    In this part of the tutorial, we will be connecting to the database with a PHP script. Please be sure you know how to upload files, and know how to connect to your database.

    Let's start the script, from now on read the comments in the code

    discuss this topic to forum

    relation tutorial

    No relevant information

    Category

      Ad Management (4)
      Calendars (3)
      Chat Systems (7)
      Content Management (24)
      Cookies and Sessions (11)
      Counters (15)
      Database Related (20)
      Date and Time (13)
      Development (19)
      Discussion Boards (8)
      E Commerce (8)
      Email Systems (13)
      Error Handling (7)
      File Manipulation (24)
      Flash and PHP (6)
      Form Processing (19)
      Guestbooks (12)
      Image Manipulation (21)
      Installing PHP (7)
      Introduction to PHP (23)
      Link Indexing (8)
      Mailing List Management (9)
      Miscellaneous (53)
      Networking (8)
      News Publishing (9)
      OOP (24)
      PEAR (6)
      PHP vs Other Languages (2)
      Polls and Voting (6)
      Postcards (1)
      Randomizing (14)
      Redirection (11)
      Searching (9)
      Security (29)
      Site Navigation (16)
      User Authentication (14)
      WAP and WML (7)
      Web Fetching (8)
      Web Traffic Analysis (15)
      XML and PHP (16)

    New

    Hot