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

Daily Test with Code Example

HTML
CSS
JavaScript
PHP-MySQL
Which tag is used in <table> to create table header cell?
<thead> <th> <td>
<table><tr>
  <th>Title 1</th>
  <th>Title 2</th>
</tr></table>
Which CSS property sets the distance between lines?
line-height word-spacing margin
.some_class {
  line-height: 150%;
}
Which function opens a new browser window.
alert() confirm() open()
document.getElementById("id_button").onclick = function(){
  window.open("http://coursesweb.net/");
}
Indicate the PHP function that returns an array with names of the files and folders inside a directory.
mkdir() scandir() readdir()
$ar_dir = scandir("dir_name");
var_export($ar_dir);
Script comments with pagination

Last accessed pages

  1. Zodiac Signs PHP code (7232)
  2. Courses Web: PHP-MySQL JavaScript Node.js Ajax HTML CSS (142534)
  3. The Essene Gospel of Peace (2504)
  4. CSS3 Flexbox Container (1086)
  5. Movie Clip Symbols (2327)

Popular pages this month

  1. Courses Web: PHP-MySQL JavaScript Node.js Ajax HTML CSS (537)
  2. The Mastery of Love (65)
  3. CSS cursor property - Custom Cursors (63)
  4. Read Excel file data in PHP - PhpExcelReader (59)
  5. PHP-MySQL free course, online tutorials PHP MySQL code (44)