PHP Tutorials

Round Corners on Image Using PHP and GD Library

Round Corners on Image Using PHP and GD Library

Sometimes we need to add round corners to some pictures like profile picture and thumbnails, also not to modify the source files. It can be achieve through CSS but to work proper on all browsers, its too hard to get. So with GD library, it can be achieved with less work. In this post I am providing an example to achieve round corners on image using PHP and GD library. …

Continue reading

Force to Download File in PHP

Force to Download File in PHP

If you want to require a force to download file upon the user visiting a web page with PHP or want to control or track your downloadable contents then this file downloader script can give you more option. Especially if you want make images or other contents like document files (doc, docx, pdf), compressed files (zip, rar), music files, css, js or any downloadable file then you must need to …

Continue reading

User Signup and Signin with PHP and MySQL

User Signup and Signin with PHP and MySQL

Authentication system is the most important part for the developers to implement in a web application. It is necessary if you want to provide limited access of your application for anonymous user. If you want to create a web application with secure admin area or a user signup and signin with php and mysql this post will help you. Here are the steps to create a simple application that allow …

Continue reading

Download File From Remote Server in PHP

Download File From Remote Server in PHP

There are many methods in PHP that helps to download file from remote server. We can use php functions like file_get_content, copy, fsockopen and fopen to download remote files. But in this post I will use curl to download file. Because it is the advanced way to work with remote resources it can download large files with minimum memory uses. Before download a file we need to find if file …

Continue reading

YouTube Video Information Using YouTube API

YouTube Video Information Using YouTube API

If you want to embed YouTube videos or want to add your video gallery then you can use YouTube API v2 to get all necessary information about the video like video title, description, category, thumbnail and others. In this post I am going to show you how to get YouTube video information using YouTube api. To get the YouTube video information in JSON format we will use CURL and pass …

Continue reading

Generate and Implement Simple Captcha Code In PHP

Generate and Implement Simple Captcha Code In PHP

To avoid automatic form submission some kind of verification should be used. CAPTCHA code submission is a best way to stop spammers. A CAPTCHA has a challenge-response test used in web form to ensure that the response is generated by a human being. In this article you will learn how to generate and implement simple captcha code in php. Most widely used captcha for verification of human being is image …

Continue reading

Calculate The Difference Between Two Dates In PHP

Calculate The Difference Between Two Dates In PHP

Sometimes It is often handy to have a proper method to get number of days and number of months between two dates. In this article, I am discussing how to calculate the difference between two dates in PHP. Calculate months between two dates: For PHP >=5.3 you can use DateTime diff that returns a DateInterval object as below. If you don’t have PHP 5.3 or higher, you can use strtotime() …

Continue reading

Upload Image with jQuery Ajax

Upload Image with jQuery Ajax

Image upload without refreshing the page is commonly used by websites. So today I am going to show you how it is easy to implement upload image with jQuery AJAX. On a single click you will be able select file from the popup window and on select the image will upload and you will see the image on the same page. I have used a jQuery plugin AjaxUpload, PHP file …

Continue reading