Make Destination Directory on File upload with PHP

You normally store the user-selected files in a specific directory but the same directory is also used by all other users.

If you are allowing to upload multiple types of files like – images, videos, doc, etc then it becomes a mess.

To avoid this you can create separate directories to store files in an organized way.

But for storing it in a more organized way you can dynamically create directories for each user for storing their files. This makes traversing to file easier.

Make Destination Directory on File upload with PHP

Read more

Dynamic dependent dropdown in CodeIgniter 3 with AJAX

Dynamically dependent dropdown commonly seen in the country, state, and city selection on the webpage. The data on the child element changes according to the value of the parent element.

The process follows the same way if there are more than 2 dropdown elements.

To do this you can either use only PHP or jQuery AJAX.

In this tutorial, I am using jQuery AJAX to make dynamic dependent dropdown in CodeIgniter.

Dynamic dependent dropdown in CodeIgniter 3 with AJAX

Read more

Dynamically load content in Bootstrap Modal with AJAX

Modals are one of the many pre-built components offered by the widely used front-end web development framework Bootstrap. Developers can display content on top of an existing page by using dialogue boxes or pop-up windows known as modals.

However, there are times when need to dynamically load content into the Modal, which is possible with AJAX.

AJAX allows data to be loaded and displayed on a page without having to reload the entire page, making the web application faster and more user-friendly.

In this tutorial, I will show you how to dynamically load MySQL database content into a Bootstrap Modal using AJAX and PHP.

I am using Bootstrap 5 in the example, if you are using any other version then also you can follow.

Dynamically load content in Bootstrap Modal with AJAX

Read more

Create and download zip file with AJAX

Zip file creation is a better way to enable the user to download multiple files in one package. This may affect the page load time according to the number of files and their size.

Arises more problems when need to create multiple zip files on page load for download.

To avoid this type of problem you can either use only PHP or jQuery AJAX to create and download the zip file when it’s required.

In this tutorial, I am using jQuery AJAX.

Create and download zip file with AJAX

Read more