SQL PHP HTML ASP JavaScript articles and free scripts to download
PHP PHP Scripts

Posting at the end of the page script

After reading an article or news or any tutorial on a website, the visitor can post his or her comments at the end. You must have seen such comments at blog pages posted by visitors are displayed at the end of the page. Below such postings there will be the form which you can use and post your comments. Such a provision adds lot of value to the main content as replies and questions are both available at one place. Author of the article can post answer to specific questions raised by readers. Over time this system itself became a FAQ ( frequently asked questions ) page as over the subject lot of discussion became available at one place. Blog pages are somewhat similar to this script. This script can be further extended to have main posting by site admin , so it can be used as Blogging script and you can run you own blog within your site.

You can compare this with a forum but there are many differences here. First here any one can post without becoming member or signing up but usually in a forum postings are allowed after signup. The process of posting became very simple as a single form is used. Here postings are focused to the main topic presented by the author. Where in a forum topic can be any thing within permitted areas of the forum.

Post your comments

We will ask the visitors to enter three fields at the posting form. One is there name, second one is there email address and third one is there comment or post. Here while displaying we will not display the email address of the poster and we will only display name and the comment.

We will use MySQL database to store the postings of the visitors. We will use one table only for these records and one more table to store site admin login information. If this script is used as a part of an existing system then this admin table is not required. Let us first discuss about the main table, we call it cmt_post. This table cmt_post will have 7 fields. Here is the structure of the table.

CREATE TABLE `cmt_post` (
`post_id` int(5) NOT NULL auto_increment, `p_name` varchar(10) NOT NULL, `dt` date NOT NULL, `name` varchar(25) NOT NULL, `email` varchar(50) NOT NULL, `dtl` text NOT NULL, `status` varchar(4) NOT NULL default 'ns', UNIQUE KEY `post_id` (`post_id`,`p_name`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;

This main cmt_post table will have fields to store the name, email address, data of post and comment. It also has to store the unique page number or page name by which we can identify which comment or posting belongs to which page. We will maintain one more filed and call it as status filed which will tell us where the posting is approved by site admin or not. By default all posting are to be approved by site admin. We will maintain this status filed with two values, ns(not seen) or fresh posting and second value is apv( approved ) . For each record once added we will generate one unique post id ( post_id) . For this post_id filed we will use auto increment property of MySQL table.

principles of working of the script in part 2



Download the full script here

This site uses one Ajax based comment posting ( where page reloading is not required ), the tutorial for this is not yet developed


Google+
Further readings
Introduction to simple Posting of user comment Script.
How the script works in comment posting script
Admin area of the comment posting Script
Installing the comment posting Script
Joe24-01-2009
Yea um, I am keep getting a error saying:


Warning: mysql_connect(): Can't connect to local MySQL server through socket '/usr/local/mysql-5.0/data/mysql.sock' (2) in /home/content/d/r/a/dragonlover/html/funtut/comment/comment/config.php on line 19
Could not connect to MySQL
smo25-01-2009
You have to check your mysql connection first. You should have correct userid and password to connect to Mysql table. There is a tutorial on this issue. First establish connection and then your script will work.
asdas17-02-2009
test comment
Haji22-02-2009
Hi there i can't login in the admin page every time i try to login it says wrong password. And i dont even know how to make admin name and password please help on how to accecc admin.. and the other thing is how to add the script into everypage in my website. thanks alot
smo22-02-2009
Go to page on installing comment posting script. It is there in further reading section. There default id and how it works is explained.
tbabatunde03-03-2009
thanks for this php tutorial
moles03-03-2009
Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\AppServ\www\comment\cmt-display.php on line 2

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\AppServ\www\comment\cmt-display.php on line 2

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\AppServ\www\comment\cmt-display.php on line 5
asd10-04-2009
Warning: mysql_connect(): Can\'t connect to local MySQL server through socket '/usr/local/mysql-5.0/data/mysql.sock' (2) in /home/content/d/r/a/dragonlover/html/funtut/comment/comment/config.php on line 19
Could not connect to MySQL...............
sasa18-04-2009
why wont this work
john doe06-05-2009
ajax feature is very cool.
james15-05-2009
let me test
winstons21-06-2009
Can somebody help me i dont anderstand whats the problem:

Warning: mysql_query() [function.mysql-query]: Access denied for user 'watching'@'localhost' (using password: NO) in /home/watching/public_html/comment/cmt-display.php on line 2

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/watching/public_html/comment/cmt-display.php on line 2

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/watching/public_html/comment/cmt-display.php on line 5
33329-06-2009
at the end. You must have seen such comments at blog pages posted by visitors are displayed at the end of the page. Below such postings there will be the form which you can use and post your comments. Such a provision adds lot of value to the main content as replies and questions are both available at one place. Author of the article can post answer to specific questions raised by readers. Over time this system itself became a FAQ ( frequently asked questions ) page as over the subject lot of discussion became available at one place. Blog pages are somewhat similar to this script. This script can be further extended to
sajjad01-07-2009
i am tesing this comments blogs
james31-07-2009
Is the tutorial and download for the script is same as the one i am now posting comments on your site?
Jack Frost31-07-2009
really good site and always with good scripts...thanks
smo02-08-2009
James, this is not the same script. Some changes are added and it is based on Ajax. The tutorial is not yet developed and download link is not kept. Shortly it will be available.
Paltonio Fraga12-08-2009
very useful programs. Thanks for this. Even not using a mysql database, we can use any/another source of data.
ahmed23-08-2009
yup not too bad but i wanna how to connect mysql with ajax
Ludwe02-09-2009
How to post a comment and the page not reload?
smo03-09-2009
By using Ajax.
Sumera11-11-2009
this site is great!!!!!!!!!
Andy John19-11-2009
Excellent post.This was actually what I was looking for, and I am glad that I finally came here! Thanks for sharing the such information with us.
Marcel26-12-2009
When will the ajax feature be ready for download? Another thing here is this. I tried using this script to add comments to the cms tutorial here but it keeps displaying the same comment for all articles. I guess the $p_name=1be is responsible. How can i make it dynamic just like the cms so i can have different comments on different pages. Please admin, note i'm working with the cms file from this website.
Tunde29-12-2009
This is good. Just some adjustment
i changed require"....php" to include"...php" and i was able to log in.
i am using dynamic php web pages so i changed
$p_name = $_GET['mytopicid']; so that a comment for a page is not onto another. I am a php newbie and very chuffed i did this on my own.
niraj19-09-2010
You have to check your mysql connection first. You should have correct userid and password to connect to Mysql table. There is a tutorial on this issue. First establish connection and then your script will work.
Khodor14-11-2010
Is there any demo for this script
Parkour05-01-2012
Your post is incredible, can’t wait for more updates
Finn23-04-2012
Thankyou this script is quite nice and easy to work with
mali30-06-2012
Is there one without MY SQL
malib10-12-2012
is there 1 with sql???
3R411-02-2014
I LOVE THIS SCRIPT
Subhra18-07-2014
Nice one
Victor20-07-2014
new post
Post Comment This is for short comments only. Use the forum for more discussions.
Name
Email( not to be displayed)Privacy Policy
1+2=This is to prevent automatic submission by spammers. Please enter the result of the sum as asked



Join Our Email List
Email:  
For Email Newsletters you can trust
HTML . MySQL. PHP. JavaScript. ASP. Photoshop. Articles. FORUM Contact us

©2000-2014 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer