Author

Preventing Multiple Submissions on the Client Side using jQuery

Do you want to prevent the user from submitting the form more than once? To prevent multiple submissions on the client side, you can just disable the submit button so a user cannot click twice. Using the jQuery code below can do the trick. Disable a button using jQuery <form class="" action="" method="post"> <h4>Please enter... » read more

How to create a Bar Chart using PHP

To create bar chart using PHP, you can use the built-in function Imagefilledrectangle() which draw a rectangle according the given x and y coordinates. The Syntax imagefilledrectangle ( resource $image , int $x1 , int $y1 , int $x2 , int $y2 , int $color ) : bool The Parameters $x1, $y1 set the top... » read more

How to draw a Pie chart using PHP

Creating an image using PHP may seem like a daunting task, but it is straightforward if you know what are you trying to draw using PHP’s GD library for images. Pie Charts in PHP To create a pie chart in PHP, create a new file piechart.php as shown below. <?php $image_width = 400; $image_height = 400;... » read more

Use Cookies to Create Page Counter in PHP

In this tutorial, we are going to learn to create a simple cookie-based visitor counter. This counter will start from zero and will be incremented for each visit. For the sake of testing the code, the counter will reset after you close the browser. setcookie() defines a cookie to be sent along the rest of... » read more

Global Variable $_SERVER Explained in PHP

$_SERVER is an array containing information about server and execution environments. The array has values for headers, paths and script locations. The values are created by the web server. Let’s go through the $_SERVER array. You can see the complete list of variables in the array using the following code. List of Complete Global $_SERVER... » read more

Create a Time Sensitive Form in PHP

A time-sensitive form lets you enter and submit the information within the time limit being specified. In this tutorial, we will create a simple form that allows you to enter your name within 5 minutes of form being loaded. If you failed to do so, it would show an error message that you are too... » read more

Understand the File Upload Error Constants in PHP

Uploading files or images can be a crucial part of any web application. Let’s say you ask a user to upload his picture in jpeg or png format. So how you are going to check if the file is being uploaded successfully? What if the file was uploaded partially due to some network problem? PHP... » read more

Get vs. Post in PHP with Examples

The GET and POST are the two highly used methods in web applications where users submit information over the website. HTML forms usually have some input fields to extract valuable information from the visitors. Either you want to send this information to any other page, or database you need to specify a method which defines... » read more

Create a Feedback form using PHP

A Feedback form can be the most convenient way to understand how users feel about your products or services. The feedback or suggestion given by the end user can be of real help to improve your outcomes or the overall process. A simple feedback form in PHP Firstly, you create an HTML form to get the... » read more

Validating the checkbox in PHP

If the checkbox is checked, then the value of checkbox will be passed on the submission of the form. Otherwise, the value is empty. You can validate the value of a checkbox only after the form is being submitted. For example: <input type='checkbox' name='accept' value='1' id='checkbox' /> I accept the Terms & Conditions. Use the... » read more

Create a Login Page Using PHP and MySQL

In this tutorial, we will learn how to create a simple authentication form using PHP and MySQL. This tutorial covers the fundamental concept of sessions and query execution. How to Create a Login Page Using PHP and MySQL I’m sure you have seen those simple login forms with user name and password that let you access... » read more

How to make your WordPress site faster

We are living in an era where everyone is consuming information at the rate no one could imagine a decade ago. Smartphones have changed the way we used to communicate and look for the info. Nowadays, people are busy – reading, searching for information, or talking on their devices. No one has the time to... » read more

How to send an Email with attachment using PHP

These days, almost every application has the ability to send an email. Apparently, the functionality looks difficult but in reality, sending an email using PHP is really easy. The syntax of the mail function is as follows: mail( string $to, string $subject, string $message [,mixed $additional_headers [,$additional_parameters]]): bool String $to will contain the valid email... » read more

Upload and Download Files Using PHP

In this article, I’ll explain the basics of file upload and download in PHP. First, I’ll explain the basics of PHP configuration options. Following that, we will go through an example to fully understand the file upload and download process in PHP. File Upload and Download in PHP There are a few PHP configuration settings... » read more