Guestbook using php

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Eminosoft
    New Member
    • Feb 2008
    • 6

    Guestbook using php

    I am doing a project on guestbook using php.so i required some information on that.please suggest me

    How can we create a guestbook application in PHP?
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    First of all, you need a server and one that runs php.
    It'd also be helpful if this server had a database which you could use, i.e. mysql.

    The Logic:
    You have a form, on a html or php page that has method set to POST (html/php doesnt really matter - it does if you're not planning on processing on a seperate page though..), you give the user some fields to fill in, ie. name, website, email, comment; you then give a submit button.
    This submit button takes you to a page (for examples sake: process.php). On process.php you have a php script that takes the user input through the POST super global. You then process this and sanatise it (see mysql_injection ), after sanatising you save the data into a mysql table.

    guestbook.php
    You connect to mysql and select the relevant database.
    Using a mysql function like mysql_fetch_arr ay() you print out the data using a while loop, in the format you'd like.

    Reading:
    To get you going -
    http://tizag.com/ - Packed full of php and mysql tutorials.
    http://www.w3schools.com/php/ - also a crowd favorite.

    Once you've got yourself going and written something of your own, come back code in hand and we'll help you further.

    Markus.

    Comment

    • ronverdonk
      Recognized Expert Specialist
      • Jul 2006
      • 4259

      #3
      Look at this tutorial for you: Creating A Guestbook Using PHP and MySQL

      Ronald

      Comment

      Working...