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 a block element?
<div> <img> <span>
<div>Web Programming and Development</div>
Which CSS code displays the text underlined?
font-style: italic; text-decoration: underline; font-weight: 500;
h2 {
  text-decoration: underline;
}
Click on the JavaScript function that can access other function after a specified time.
insertBefore() setTimeout() querySelector()
function someFunction() { alert("CoursesWeb.net"); }
setTimeout("someFunction()", 2000);
Click on the instruction that returns the number of items of a multidimensional array in PHP.
count($array) count($array, 1) strlen()
$food =["fruits" =>["banana", "apple"), "veggie" =>["collard", "pea"));
$nr_food = count($food, 1);
echo $nr_food;       // 6
Script comments with pagination

Last accessed pages

  1. SBMD - Simple Backup MySQL Database (5002)
  2. XML Documents (713)
  3. Sending data with GET and POST in the same request (7986)
  4. Convert XML to JSON in PHP (12411)
  5. Simple Flash animation, Save, Export (1937)

Popular pages this month

  1. Courses Web: PHP-MySQL JavaScript Node.js Ajax HTML CSS (324)
  2. Read Excel file data in PHP - PhpExcelReader (118)
  3. The Four Agreements (97)
  4. PHP Unzipper - Extract Zip, Rar Archives (94)
  5. The Mastery of Love (87)
Chat
Chat or leave a message for the other users
Full screenInchide