This is a PHP-AJAX script to add comments in the website; created with PHP, MySQL (using OOP technology, classes and objects (Object Oriented Programming)), and JavaScript (with jQuery).
- If the page(s) of your website has tens of comments, it's a good ideea to paginate them; the page will load faster and the content is easy to read. With this script, the comments can be paginated to a number of comments per page defined by the administrator, and they are displayed with jQuery effects.
The script paginate the comments, without affecting the rest of the page content, or page URL, and it can be included in both HTML, and PHP files (but the server must have installed PHP).
• To Download it, click:
Comments script with pagination
- By default, the script will allow all visitors to post comments, but if you have a register /login script, you can set that only the logged users to add comments.
- The script can be used with multiple pages of a site, whatever the type of the page URL (modified or not with mod-rewrite).
- The comments are stored into a MySQL table and displayed in UTF-8 encoding. Thus can be added less common character sets, such as diacritics, special characters, or characters specific to other languages. For MySQL queries it is used PHP PDO.
- In the comments can be added "smiles" and an image uploaded by the user on the server. The image is proportioned in the comment to a width of 125 pixels, but when you click on it, will be displayed in full page. The text in comments can be formated with bold, italic, and underline.
- Maximum comment size is set to 600 characters, and the user can add a website address to be associated with his name.
- For anti-spam protection, the form to add comment has a verification code (captcha), and the time when the comment is added it is stored in Session and Cookie, so, the user can add only one comment in an interval of 5 minutes.
- The script can send email notifications when new comments are added, if the user select this option.
- In the notification mail, the user receives a link to the page with the comments, and a link to unsubscribe if he/she wants to not receive other notification when new comments are added in that page.
- In the database it is stored the IP of the user which posted the comment, visible only for admin.
- Management of the comments (modification, delete) can be easily done by the administrator, directly in the current page. The admin can log in with the form that appears after clicking on the
Administrator. When Admin logs in, to each comment appears the options:
MODIFY, DELETE, as you can see in this image (
click on it):
- This script is free (
does not provide support or personal modifications).
•
More details about installation, and other settings, you'll find in a "Read.html" file, in the archive with the script.
- The comments will look like in this image:
It was successfully tested with Mozilla Firefox, Internet Explorer, and Opera, for a general configuration on localhost with XAMPP, and also on the server of the website
coursesweb.net. If on other systems does not work properly, depends on their configuration. Problems can appear especially on free hostings which can have restrictions on the "session", or not support PDO; or if you modify something in the script code, without knowing PHP and JavaScript.