Php-mysql Course

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

To test this Script, click -> Test- 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):
Admin - Comments script with pagination
- 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:
Comments script with pagination

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 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.

Daily Test with Code Example

What attribute makes a radio button or checkbox input selected?
checked="checked" selected="selected" disabled="disabled"
<input type="checkbox" name="a_name" value="value" checked="checked" />
What CSS value scales the background image to the largest size contained within the element?
repeat-x contain linear-gradient
#id {
What operator is used to determine the rest of the division of two numbers?
% * /
var rest8_7 = 8 % 7;
Indicate the PHP function that rounds a number up to the next highest integer.
floor() ceil() abs()
$nr = ceil(3.5);
echo $nr;        // 4
Script comments with pagination

Last accessed pages

  1. TV-Screen shape with CSS (2550)
  2. $_GET, $_POST and $_REQUEST Variables (29917)
  3. Send Email with Nodemailer (2076)
  4. Courses Web: PHP-MySQL JavaScript Node.js Ajax HTML CSS (109107)
  5. Using the Bone Tool (3385)

Popular pages this month

  1. Courses Web: PHP-MySQL JavaScript Node.js Ajax HTML CSS (62)
  2. JavaScript Course - Free lessons (43)
  3. Read Excel file data in PHP - PhpExcelReader (43)
  4. PHP-MySQL free course, online tutorials PHP MySQL code (38)
  5. HTML Course - Free Lessons (37)