By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,347 Members | 1,390 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,347 IT Pros & Developers. It's quick & easy.

Guestbook using php

P: 6
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?
Feb 23 '08 #1
Share this Question
Share on Google+
2 Replies


Markus
Expert 5K+
P: 6,050
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_array() 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.
Feb 23 '08 #2

ronverdonk
Expert 2.5K+
P: 4,258
Look at this tutorial for you: Creating A Guestbook Using PHP and MySQL

Ronald
Feb 23 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.