المشاركات

عرض المشاركات من أكتوبر, ٢٠١٧

How to Upload File to FTP Server using PHP

صورة
Hi, in today's post we will see how to upload files to ftp server using php script . File management via FTP is an essential skill for a web developer. A good FTP client would handle FTP communication, upload and download files from FTP server efficiently. But at times you may want to do it programmatically. With PHP, the native FTP functions allow you to easily handle all kinds of file operations with ease. Uploading files using PHP FTP functions is almost similar to doing it with an FTP client. Come on, I'll show you how to transfer files to the server through ftp protocol in php. Connecting FTP Server with PHP: When you work with FTP protocol, you must establish a client-server connection. To do this, you must first connect to the FTP server and then log on using the credentials. The following are the two PHP functions you need for this step. ftp_connect(ftp_host) ftp_login(ftp_connection, ftp_username, ftp_password) Note that you need permission to log in an...

Take Webpage Screenshot using PHP and PageSpeed Insights API

صورة
Hi! Today I have come up with an interesting post which is about taking screenshot of webpage using PHP and Google PageSpeed Insights API. This handy feature will help you provide thumbnail preview of websites to improve user experience on your sites and applications. There are several third-party screen capture APIs and Plugins available in the market but here I'm going to show you a very simple solution. Yep that is to use Google PageSpeed Insights API to capture screen shot. And the fact that it doesn't requires registration or apikey is really good. In general, Google PageSpeed Insights API is used to measure site performance. But you can also use it to capture screenshot of the website / webpage from a url. Let's see how to get the website screen shot from url using PageSpeed Insights API in PHP. Using Google's PageSpeed Insights API: Using Google PageSpeed Insights API to grab the webpage screen shot is very easy. All you have to do is call the api w...