How to Extract the Zip file with PHP

You don’t need to require any other extra plugin for working with Zip files.

PHP has a ZipArchive class that allows us to create a zip file or extract the existing file.

ZipArchive class extractTo() method is used to extract the zip file that takes the destination absolute path as an argument.

How to extract the Zip file with PHP

Read more

How to get data from MySQL with AngularJS – PHP

With only using AngularJS it is not possible to get data from the MySQL database because it only handles Client-side requests.

You have to use any Server side language at the backend which handles the request and returns the response.

In AngularJS $http service is used to send AJAX requests.

How to get data from MySQL with AngularJS - PHP

Read more

Upload and store an image in the Database with PHP

Uploading and storing an image in a database using PHP is a common task in web development. By storing images directly in the database, you can easily manage, retrieve, and manipulate image data alongside other relevant information. This simplifies data backup and recovery processes and ensures data integrity.

In this article, I will show you 3 approaches to accomplish this –
1. Storing image files by saving their file path or name,
2. Encoding images as base64, and
3. Storing images as BLOB (Binary Large Object) data.

Additionally, we will delve into the retrieval process to display the uploaded images from the database.

By the end of this article, you will have a better understanding of various techniques to upload images to a database and retrieve them for display on your web application.

Upload and store an image in the Database with PHP

Read more

Login page with Remember me in PHP

Remember me option allows the user to automatically get logged in to the website without entering its username and password again.

To do this I am using $_COOKIE that store value on the client-side for detecting the user. Next time when the user comes it will automatically redirect to the homepage.

Encrypt the value before storing it to $_COOKIE and decrypt it while access. It will automatically destroy after 30 days.

Login page with Remember me in PHP

Read more