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

Show Notification, prompt, and confirmation with Overhang.js

Overhang.js is a lightweight jQuery plugin that displays notification, prompt, and confirmation on the screen.

This adds a strip bar at the top of the page when it executes.

It has various options that help us to customize e.g. duration, speed, etc and change the look according to the website theme e.g. change background, accent, and message text color.

It also uses the jQuery UI library to display an alert on the screen.

Show Notification, prompt, and confirmation with Overhang.js

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

How to change page title and icon on Page leave with jQuery

Page titles and icons are important elements of a website that help visitors identify and remember the website they’re visiting.

However, sometimes you may want to get back the user’s attention to your site by animating the site page title and icon when the user leaves your website or open another tab.

It can be done with and without the jQuery plugin.

In this tutorial, I show how you customize the tab with iMissYou and mFancyTitle jQuery plugins and with the only jQuery on-page leave.

How to change page title and icon on Page leave with jQuery

Read more