Category: PHP

You already know that in HTML there is no search option in the dropdown element. When you press any single key on the dropdown then it takes you to the option but not allows you to search whole or particular string.

There are many jQuery plugins which do this for you.

But in this tutorial, I am not using any jQuery plugins for implementing it.

When it’s required?

This kind of feature generally requires when we have the long list of options in the Select element and want to make an easier navigation for users.

By this way, you enable user to search option on dropdown

The most common example is Country Dropdown which you have seen on many websites when you go for Registration.

What in the Demonstration ?

Creating a simple form which also contains a drop-down element. When the dropdown gets clicked then showing the Search Box and according to the input show suggestion.

Make a Dropdown with Search Box using jQuery

Read More Make a Dropdown with Search Box using jQuery

AJAX Jquery PHP

On your Client-side with jQuery, JavaScript you cannot delete any files. You need to use Server-side scripting for doing it.

In PHP, you can simply use unlink() function this removed a file from your server if it exists.

Sometimes you have the requirement to delete a resource file without reloading the page. This cannot total done with PHP you need to use jQuery or JavaScript with it by which you need to send AJAX request to your server for removing a file and according to the response make changes on your Client-side.

What in the demonstration ?

For demonstration purpose, I create a number of <img> element with Delete Button. When the Button gets clicked then removing the file using jQuery AJAX and replace the <img> source with the default image.

How to delete file with jQuery AJAX

Read More How to delete file with jQuery AJAX

AJAX PHP

There are many cases where we have required to update certain part of the web page on the regular basis.

For example – showing live cricket or football score, display latest news feeds,etc.

In this tutorial, I show How to use jQuery AJAX to implementing this.

There are two ways to send AJAX request on specified time –

  • By setInterval() and
  • By setTimeout() JavaScript functions.

Both do the same work but they are reliable for certain cases, which I discuss in this tutorial.

Read More How to fire AJAX Request on Regular Interval

AJAX Jquery PHP

The phpMyAdmin allows us the number of ways to export the Table data one of the ways is CSV(Comma Separated Value).

In this post, I show How you can export MySQL table data as CSV file in PHP.

There are two ways to create a CSV file in PHP –

  • By comma separated string, or
  • using fputcsv() method

In this tutorial, I am using the fputcsv() method which writes an array to the file line by line.
Read More How to Export MySQL Table data as CSV file in PHP

DataBase PHP

We generally require sorting feature in the Table layout when there is many columns or lots of data.

In this tutorial, I show you How you can implement it using AJAX and PHP within your project.

In the demonstration, I am creating a table layout which shows the list of employees and adding click event in header column. Within click, calling a function in which passing column name as an argument and sending AJAX request.

Read More Sorting the Table by clicking Header with AJAX

AJAX Jquery PHP

AJAX Javascript Jquery PHP

PHP provides ZipArchive Class which allows us to create Zip file. For this, we need to create Object of that class and use addFile method which takes file name for adding the file to zip archive file.

When it’s required?

Programmatically Zip creation mainly requires when preparing the group of file and folders for downloading.

In the tutorial, demonstration I will read all files from a folder and add those files for Zipping.

How To Create And Download A Zip File with PHP

Read More How to create and download a Zip file with PHP

PHP

In this tutorial, I will show How you can insert data into MySQL table from CSV file using PHP.

The common example of this you will see in PHPMyAdmin where you can import data to MySQL table in multiple formats (.sql, .csv, .xml, etc).

Read More Import CSV file data to the MySQL using PHP

PHP

In this tutorial, we learn How you can sort table data when table header gets clicked in Pagination using PHP.

If you don’t now What is pagination? and How to create it,  I recommend you to check out Pagination in PHP  tutorial. I explain it in short What pagination is ?.

What is pagination?

Pagination means where records are divided into multiple pages because of that all records not available at once to the user. The user sees records one by one and easily navigate to backward and forward directions. It is best when you have a long list of data.

It reduces page load time and provides the better user-friendly interface.

Read More Table sort on header click in the pagination using PHP

PHP

In this tutorial, we will learn How you can use jQuery to show and hide the table column.

When does it require ?

When the table has multiple columns and you want to allow the user to hide and show those columns which user doesn’t want to see on the screen. This gives more flexibility to the user.

What in the Demonstration ?

In the demonstration, we will create a Table structure which shows employees list and adding some checkboxes. When checkboxes get checked then hiding the Table column based on selection and reset it when it is unchecked.

Read More How to Hide and Show the Table column using jQuery

Jquery PHP