Most of webmasters want to display weather information on their website. So I have decided to provide a tutorial to do this via PHP script.
There are tones of APIs that provides weather information like Yahoo weather, Open Weather Map, Accuweather, etc but my favourite is Open Weather Map. Lets start with OpenWeatherMap API.
Htaccess redirect entire site to new domain
If you want to move your website to new domain without hurting its SEO then use 301 redirect. Most simple way to do this is using htaccess mod_rewrite. Here I will explain 2 methods to redirect whole site to new domain. Continue reading “Htaccess redirect entire site to new domain”
PHP domain age checker script
I was looking for php domain age checker script so I googled for it, but didn’t found any useful code. So I decided to write my own. It may be useful for webmasters. This script is based on our previous php whois script which extracts whois information from whois server. Continue reading “PHP domain age checker script”
Load jQuery if not already loaded
I was working on jQuery based website widget but I can not include it directly because some website already has jQuery in their pages. So I found a solution to load jQuery if not already present in current page. Continue reading “Load jQuery if not already loaded”
PHP strong random password generator
Webmaster often needs to generate random password for new users. There are many way to do this but I found a very simple method which can generate strong password of any length. This method is based on str_shuffle() function which randomly shuffles a string. Continue reading “PHP strong random password generator”
PHP script to extract emails
This is a simple php script to extract email address from webpage. This will extract all unique emails and output each in new line. You can modify this script as per your need. Continue reading “PHP script to extract emails”
Backup and restore large mysql database
If you have very large mysql database then it is very hard to backup and restore using the conventional phpmyadmin or any other program ( like bigdump).
In this Tutorial I will explain you how to backup and restore a larger database ( having millions of rows). This tutorial can be used while moving your database from one server to another.
First you need to have shell (ssh) access to your server.You can use any free program like putty to connect your server Then follow the steps: Continue reading “Backup and restore large mysql database”
How to change Mysql data directory location?
Mysql is most famous open source RDBMS (Relational database management system) software used by millions of websites. Most of website with very large Mysql database experience storage problem because /var partition is to small which holds Mysql data files and folder by default. If you are experiencing such a problem then you have to move your Mysql data directory to other linux partition (eg: /home). To change your directory without affecting Mysql configuration. Follow these steps. Continue reading “How to change Mysql data directory location?”
PHP script to count Google backlinks and Indexed Pages
To get backlinks and indexed page count from Google most webmasters use scrapping Google search page. It is not a good idea because it fails some time and very slow.
So we can use Google Ajax search API instead of scrapping whole page. It will return data in JSON object which is much smaller then html page.
Although Ajax search API is rate limited to 100 queries per IP per Day but still it’s a good way. Continue reading “PHP script to count Google backlinks and Indexed Pages”
PHP force file download
By default most of the file types (eg: txt, jpg, png, gif, html, pdf, etc.) displayed in browser instead of download. But we can force browser to download these files instead of showing them. In this article I will explain how to force file download in php. Continue reading “PHP force file download”