Habdul Hazeez

Habdul Hazeez

About Habdul Hazeez

Habdul Hazeez is a technical writer with amazing research skills. He can connect the dots, and make sense of data that are scattered across different media.

howto · 2025-03-13

How to Check if URL Contains a String With JavaScript

Learn how to check if a URL contains a specific string using JavaScript. This article covers methods like String.prototype.indexOf, String.prototype.includes, and Regular Expressions, providing clear examples and explanations. Discover the best practices for effective string checking in your web applications today.

howto · 2025-03-13

The Correct Way to Use MySQL SLEEP() Command

This article will teach you two ways to use the MySQL SLEEP() command, including SLEEP() and DO SLEEP(). You'll learn how to implement these commands effectively in your SQL queries and understand their behavior in various scenarios. Enhance your database management skills with practical examples and detailed explanations.

howto · 2025-03-13

How to Find the Date of a Day of the Week in PHP

This article teaches you how to get the date of a numerical day of the week using PHP. We assign numbers 0 to 6 to weekdays from Sunday to Saturday. By utilizing PHP's date and strtotime functions, you will learn how to easily find the date corresponding to any given day of the week. Whether for calendar applications or reminders, this guide provides clear examples and explanations for effective date manipulation in PHP.

howto · 2025-03-13

How to Select Multiple Classes in jQuery

This article teaches you two methods to select multiple classes in jQuery. Explore how to use a comma-separated selector and the filter method to match elements with specified classes. Learn which method is faster and more efficient for your web development projects. Enhance your jQuery skills today!

howto · 2025-03-11

How to Enable PHP in Apache2

This article will teach you how to enable PHP in Apache2 using a2enmod, LoadModule, and a symbolic link. In case you get a module error about PHP, we'll teach you how apt-get can fix it. Follow our step-by-step guide for seamless PHP integration with Apache2.

howto · 2025-03-11

Syntax to Check for Not Null and an Empty String in PHP

This article teaches you how to check for not null and an empty string in PHP. We'll use PHP empty() and is_null() functions along with the negation operator. Enhance your data validation skills in PHP with these essential techniques for ensuring your variables hold meaningful data.

howto · 2025-03-11

How to Add Elements to Array Using jQuery

Learn how to add elements to an array using jQuery with this informative guide. Explore the push() and merge() methods through practical code examples, enhancing your skills in managing arrays for web applications. Perfect for beginners and experienced developers alike, this article will help you master array manipulation in jQuery.

howto · 2024-02-15

How to Describe Database Table With Mysqli_query in PHP

This article teaches you how to describe a database table using mysqli_query. We'll describe the table using the SQL DESCRIBE command. The result in the browser will look like what you'll see in the MySQL console.

howto · 2024-02-15

How to Draw a Graph in PHP

This article explains how you can create a graph using pChart in PHP. The first is a bar chart, the second is a spline chart, and the last is a histogram from MySQL.

howto · 2024-02-15

How to Create a Timer and a Clock Using jQuery

This article introduces three examples of creating a timer and a clock in jQuery. The first example is a timer that starts once you open the page, while the second and third examples contain a clock implemented differently.

howto · 2024-02-15

How to Clear Form Fields With jQuery

To clear form fields using jQuery, you can set their values to an empty string. This article teaches you two ways that you can use. The first considers checkboxes while the second does not.

howto · 2024-02-02

How to Check if Post Exists in PHP

This article will teach you how to check if post exists in PHP with isset(), empty(), negation operator and empty string check

howto · 2024-02-02

How to Set Up a Search System With PHP and MySQL

This tutorial will teach you how to set a simple search system with PHP and MySQL. You will learn how to create a MySQL database and how to use a prepared statement with the LIKE operator in SQL.

howto · 2024-02-02

How to Fetch MySQL Results With PDO in PHP

This tutorial teaches you how to fetch results from a MySQL database with PHP PDO. You'll use PDO methods like fetchall() and fetch() and learn how to iterate over the PDO results with a while loop.

howto · 2024-02-02

How to Encode HTML in PHP

This tutorial will teach you how to encode HTML in PHP. You will use htmlspecialchars(), htmlentities() and a custom method.

howto · 2024-02-02

How to Get Class Name in PHP

This tutorial will teach you how to get a class name in PHP. You will use get_class(), PHP class constant, and ::class in an object.

howto · 2024-02-02

How to Create and Get PHP Class Constants

This tutorial will teach you how to create and get class constants in PHP. You will use the const keyword, PHP access modifiers, and the final keyword. Also, you'll learn how to emulate class constants with static variables.

howto · 2024-02-02

How to Filter Arrays in PHP

This tutorial will teach different methods you can use to filter arrays in PHP. The methods will use PHP built-in functions like array_intersect_key, array_filter, array_keys, and array_flip.

howto · 2024-02-02

How to Loose and Strict Equality Checks in PHP

This tutorial will teach you how to perform loose and strict equality checks in PHP. You'll use PHP built-in equality signs like double equal, not equal and use the strict versions of these checks.

howto · 2024-02-02

How to Execute Multiple MySQL Queries in PHP

This tutorial will teach you to execute multiple MySQL queries with PHP. You'll execute the queries with PHP prepared statements and multi_query, a built-in PHP function.

howto · 2024-02-02

How to Print Array Keys in PHP

This tutorial will teach you different methods you can use to print the keys of PHP arrays. These methods will use the foreach loop and the array_keys function.

howto · 2024-02-02

How to Set Environment Variable in PHP

This tutorial is an illustrated step-by-step guide that teaches you how to set the environment variable for PHP in a local development environment like WAMP.

howto · 2024-02-02

How to Check for Numerical Characters in PHP

In this tutorial, we'll learn about how to check for numerical characters in PHP. We will use PHP built-in functions like ctype_digit, preg_match, strpos, is_numeric, and filter_var.

howto · 2024-02-02

How to Encode HTML With JavaScript

This tutorial will teach you how to encode an HTML string using different methods. The common thing among these methods is string replacement which replaces potentially dangerous characters.

howto · 2024-02-02

How to Convert SVG to PNG With JavaScript

This tutorial teaches how to create a PNG image from SVG. We'll use the Canvg JavaScript library and the toDataURL method.

howto · 2024-02-02

How to Redirect Page With Onclick in JavaScript

This tutorial will teach you how to create a JavaScript redirect when a user clicks on an HTML button. We'll use the onclick function to listen to events. If the user clicks the button, it'll redirect to another page.

howto · 2024-02-02

How to Enumerate Object Properties in JavaScript

This tutorial will teach you how to enumerate JavaScript objects using different methods. These methods will use for...in, Object.keys and Object.entries.

howto · 2024-02-02

How to Hide JavaScript Code in View Source

This tutorial will teach you how to hide JavaScript code from the View Source functionality of a web browser. We'll go through the step-by-step instruction on how to achieve this.

howto · 2024-02-02

How to Get the Current URL With JavaScript

In this tutorial, we'll tackle about how to get the URL in JavaScript using four different methods. These methods will use window.location.href, document.location.href, document.URL, and document.baseURI.

howto · 2024-02-02

How to Define Do Nothing to Keep User on the Same Page in JavaScript

This tutorial will discuss how to define do nothing to keep a user on the same page in JavaScript. The code keeps the user on the page when they click on the Cancel button of a confirm dialog window.

howto · 2024-02-02

How to Get onClick Button ID in JavaScript

This tutorial will teach you how to get the ID of a clicked HTML button. We'll explain four methods that you can use to get the ID. These methods include the use of this.id, event.target.id, addEventListener, and jQuery.

howto · 2024-02-02

How to Remove Commas From String in JavaScript

In this tutorial, we will teach you how to remove commas from a string. We'll use the replace method, join method and lodash replace() method. To perform arithmetic computations, we'll use the parseFloat function on the resulting string.

howto · 2024-02-02

How to Validate Numbers in Form Inputs in JavaScript

This article will teach you how to validate numbers in JavaScript. We'll use Regular Expression and JavaScript functions that include isNaN, parseFloat, and isFinite.

howto · 2024-02-02

How to Count Array Element Occurrences in JavaScript

This article will teach you how to count the number of occurrences of an array element. We'll utilize an object-based approach, Array.prototype.reduce, a custom function and Lodash.

howto · 2024-02-02

How to Scroll to Bottom of a Div in JavaScript

This article will teach you how to scroll to bottom of a div using a combination of scrollTop and scrollHeight, jQuery, jQuery .animate(), Element.scroll(), and Element.scrollIntoView().

howto · 2024-02-02

How to Strip HTML Tags From String in JavaScript

This article introduces how to strip HTML tags from strings using a regular expression, the textContent method, jQuery, the DOM parser interface, and strip-string-html package.

howto · 2024-02-02

How to Create Customized Alert Box in JavaScript

This article teaches you how to create a customized alert box using jQuery UI, SweetAlert2, and a custom alert function.

howto · 2024-02-02

How to Add Vector Class in JavaScript

This article will teach you how to add vectors in JavaScript using a for loop, ES6 Map, ES6 class, and extending the native Array class.

howto · 2024-02-02

How to Validate Email With Regex in JavaScript

This article will teach you multiple regular expressions that'll validate an email address in JavaScript. So you can select a pattern that suits your use case.

howto · 2024-02-02

How to Add JavaScript MDCRipple to Ajax Loaded Button

This article teaches you how to add MDCRipple to an HTML button loaded via AJAX. We'll set up a local server. Afterward, we'll import the MDC CSS and JavaScript files via UNPKG CDN.

howto · 2024-02-02

How to Make Ajax Call Without jQuery

This article teaches you how to make AJAX calls without using jQuery. We'll do this using XMLHttpRequest and the Fetch API.

howto · 2024-02-02

How to Get Stack Trace in JavaScript

This article teaches you how to get a JavaScript stack trace using the error object, console.trace(), a custom function, and StackTrace.js.

howto · 2024-02-02

How to Use a Seed to Generate Random Numbers in JavaScript

This article tackles how to use a seed to generate a random number in JavaScript. We achieve this thanks to PRNGs that take a seed and return a random number based on that seed.

howto · 2024-02-02

How to Get Select Value From DropDown List With JavaScript and jQuery

This article teaches you to get a select value using Vanilla JavaScript and the jQuery library. We'll do this by explaining two examples. The first shows the Vanilla JavaScript approach, while the second is for jQuery.

howto · 2024-02-02

How to addEventListener vs. Onclick in JavaScript

This article explains seven differences between addEventListener and onclick. We accompany our explanation with code examples that shows how both work in the web browser.

howto · 2024-02-02

How to Process Form Data With Mysqli_real_escape_string

This article teaches you how to process form data using mysqli_real_escape_string. We'll set up a local server, create the database and a table. Afterward, you'll learn how to prevent an error when using mysqli_real_escape_string.

howto · 2024-02-02

How to Change MySQL Root Password on Mac

This article teaches you how to change the MySQL root user password on OSX. We'll use XAMPP, so you can change the password using the MySQL console.

howto · 2024-02-02

How to Open MySQL Using Mac Terminal

This article will teach you how to open MySQL using a Mac terminal. We'll show you how to do this on macOS Catalina and later. And also, macOS Mojave and earlier.

howto · 2024-02-02

How to Use CURRENT_TIMESTAMP as Default in MySQL

This article teaches you how to use CURRENT_TIMESTAMP as DEFAULT in MySQL versions less than 5.6.5. As a result, you can prevent MySQL Error 1293. Our methods include reordering the table columns, using DEFAULT 0, and a time value.

howto · 2024-02-02

How to Create Table Alias With MySQL VIEW and MERGE

This article will teach you how to create a table alias using MySQL VIEW and MERGE. In both cases, changes in the original table will reflect in the aliased table. Also, the results of SELECT queries on the aliased and original table will be the same.

howto · 2024-02-02

How to Use CSS Style in PHP

This article will teach you three methods that'll help you use CSS styles in PHP. The first method is via a PHP-only file and the second is to embed PHP in an HTML+CSS file. Then the third method will use inline CSS in PHP echo statements.

howto · 2024-02-02

How to Get UTC Time in PHP

This article teaches you how to get UTC time in PHP using the date_default_timezone_set(), gmdate(), strtotime(), date() methods, and the DateTime object.

howto · 2024-02-02

How to Save Image From URL in PHP

This article teaches five methods to save an image from a URL in PHP. These methods will use functions like file_put_contents(), copy(), fopen(), fread(), fwrite(), and gzdecode().

howto · 2024-02-02

How to Trigger the Same Function From Multiple Events in jQuery

This article teaches you how to trigger the same function from multiple events in jQuery. We'll show two examples that show you how to do this using a jQuery API. The first example tracks user movements in HTML form inputs. While the second will change an HTML element background color.

howto · 2024-02-02

How to Submit Form With AJAX in jQuery

This article teaches you three methods that will submit a form using AJAX-in-jQuery. The first is direct use of AJAX-in-jQuery while the second employs the AJAX Form Plugin. In the third method, we use the FormData object to grab the form data before sending it using AJAX.

howto · 2024-02-02

How to Change Background Color of an Element in jQuery

This article teaches you how to use jQuery to change the background color of an element on mouseover. We'll achieve this using two jQuery APIs which are queue() and hide().

howto · 2024-02-02

How to Check jQuery Version in a User Browser

This article teaches you how to get a jQuery version on a web page using two methods. The first method will check the version if the web page has loaded jQuery. While the second method checks the version if jQuery exists in the window object.

howto · 2024-02-02

How to Set and Delete a Cookie in jQuery

This article teaches you two examples that shows how to set and delete a cookie using jQuery. In the first example, you'll use a plugin called jquery-cookie that you can get from GitHub. The second example will use a custom function to create and delete the cookie.

howto · 2024-02-02

How to Remove an Event Listener in jQuery

This article teaches you five ways that show you how to remove an event listener in jQuery. Depending on how you added the event listener, you can implement any of the following methods.

howto · 2024-02-02

How to Create Multiselect Dropdown in jQuery

This article teaches you how to create a multiselect dropdown in jQuery. We'll do this using three libraries; Select2, Selectize.js, and jquery multiselect.js. These libraries have different implementations, but they'll help you create a multiselect dropdown.

howto · 2024-02-02

How to Remove a CSS Property Using jQuery

This article teaches you four methods that will remove a CSS property using jQuery. These methods will use four jQuery APIs which are css(), removeAttr(), removeClass(), and prop().

howto · 2024-02-02

How to Select by Data Attribute in jQuery

This article teaches you two methods that'll select custom HTML5 data attributes using jQuery. The first method will select the data attributes using their surrounding HTML tags. For the second method, you'll use jQuery Selectors defined in the jQuery API documentation.

howto · 2024-02-02

How to Toggle Checkboxes on and Off in jQuery

This article explains three methods that allow you to toggle multiple checkboxes at once using jQuery. The three methods will use three methods available in jQuery; these are prop(), each(), and trigger().

howto · 2024-02-02

How to Remove All Classes With jQuery

To remove all classes with jQuery you can use three jQuery methods and one JavaScript property. The jQuery methods are removeClass(), removeAttr(), and attr(); while the JavaScript property is the className property. This article teaches you how to use them all with practical code examples.

howto · 2024-02-02

How to Find Element With Data Attribute in jQuery

To search for an element with a data attribute using jQuery, you can use the find() method, the filter() method, or a CSS attribute selector. This article teaches you how you can use them all using practical code examples.

howto · 2024-02-02

How to Disable Checkboxes in jQuery

To disable checkboxes in jQuery, you can use the jQuery attr() and prop() methods. This article teaches you how to do it using two detailed examples.

howto · 2024-02-02

How to Toggle a Text With jQuery

To toggle a text with jQuery, you can use the text() method or extend the jQuery library with a custom function that toggles the text. This article teaches you how to use both methods with code examples.

howto · 2024-02-02

How to Set Hidden Field Value With jQuery

To set a hidden field using jQuery, there are three options that you can use. The first and second will use the val() and attr() methods while the last one will use a CSS attribute selector.

howto · 2023-12-11

Examples on Using the SoapClient in PHP

In this article, we present six examples that show you how to work with WSDL files using PHP SoapClient. Before that, we'll explain how you can get the function and types from a web service. This is a must if you want to use the web service.

howto · 2023-10-12

Patterns for Multiple JavaScript Constructors

This article will teach you five different patterns for multiple constructors in JavaScript. These patterns include parameter sniffing, static methods, methods in functions, optional parameters with defaults, and single object literal.

howto · 2023-10-12

JavaScript Annotation: How Decorators Will Add Annotation Syntax to Classes

This article explains how annotation will work when decorators become available in JavaScript.

howto · 2023-10-12

The Effect of JavaScript Plus Equal

In this article, you'll learn what happens when you place JavaScript plus equal between numbers, strings, and in-between a string and a number.

howto · 2023-10-08

Href # vs JavaScript Void

This article explains when to use href # and javascript:void(0) for JavaScript links. This helps you decide which one to use based on your use case. Also, we'll explain a better approach that you can use for JavaScript links.

howto · 2023-01-30

Undefined Index With PHP Post

This article teaches you four solutions to undefined index in a PHP post array. The solutions will use isset(), array_key_exists(), in_array(), and the Null coalescing operator. First, we'll reproduce the error and then we'll show you the solutions. Meanwhile, in PHP 8, undefined index is the same undefined array key.

howto · 2023-01-03

Session ID in PHP

This article will teach you how to work with PHP Session id. You will learn how to start and check for session ids using session_start() and session_id()

howto · 2022-06-28

MySQL Workbench: Edit Read-Only Table Data

This article will teach you how to edit read-only table data in MySQL Workbench. First, we'll create the read-only table, and then we'll show you how to edit it. We'll do all these using MySQL 8.0.29 and MySQL Workbench 8.0 Community Edition (CE).

howto · 2022-06-17

Solutions to the Deprecated Mysql_connect in PHP

This article will teach solutions to the deprecated mysql_connect in PHP. These solutions include mysqli_connect (procedural and OOP) and PHP Data Objects (PDO).

howto · 2022-05-24

Differences Between SQL and MySQL

This article explains five differences between SQL and MySQL. Our explanations will include both code and words, so you'll have a clear understanding on the differences between SQL and MySQL.

howto · 2022-04-01

Different Ways to Compare Dates in PHP

compare dates in php with strtotime(), time(), date() and DateTime object

howto · 2022-02-22

Encode Image to Base64 in PHP

This article will teach you how to encode image to base64 in PHP. You'll use a combination of functions like pathinfo, file_get_contents, base64_encode, and mime_content_type in PHP.

howto · 2022-02-15

Performance and Readability of for Loop and foreach Loop in PHP

In this article, we compared a for loop and foreach based on execution speed and readability. In most cases, the for loop has better readability and executes faster than the foreach loop.

howto · 2022-02-08

Enumerations in PHP

This tutorial will teach how to create and use enumerations in PHP. You'll learn how to emulate an enumeration with abstract classes. Also, you'll learn how to work with native enumerations in PHP.