Category Archives: PHP
Extract Urls from a remote webpage using PHP
Scraping data from website is extremely popular now a days. I have written a simple website parser class to grab all the urls from a website. Shared the class below for all to see and fun. We will use the parser class below to extract all image sources and hyper links from a website. Uses:Create…
Website thumbnail using API
Just recently, I have developed a page cast module for Greenarrow.com to show users profile’s thumbnail image on the fly. Before doing that I have googling and found couple of good solutions: thumboo.com webthumbnail.org and webthumb.bluga.net etc. webthumb.bluga.net is the best solution in between those though it’s depend on windows hosting. You can have a…
Google weather API not working
Recently google has shutdown their weather API silently which breaks one of my clients first page application name Greenarrow.com. I think many developers and users were (and still are) outraged, but at least they have some time to breathe as because iGoogle isn’t going away until November 1, 2013. So, there are still one year…
Date Time difference and a new time adding intervals in days, week, month etc.
I’ve written a DateTime helper class to get: DateTime difference as an object and string DateTime details as an array and object Repeat DateTime by minute, hour, day, week, month, year using interval etc. You can checkout the repository from github.com. Uses: View Demo
PHPMailer: Called Mail() without being connected
I was getting the error message to send email using PHPMailer but didn’t get so much help after googling. Then, started to debug the error source and found that it generate for SMTP port and protocol mismatch. Usually, SMTP port is not same for different protocol with/without ssl. So, It’s very important to find the…
Hide the fact that the web pages are written in PHP
Sometimes you may want to hide the fact of your web site’s written language to visitors then you can do it easily by using .htaccess Say, you have developed your site by using PHP and wanted to show it as ASP then you can do it by using following tricks: Just add following line in…
Import contacts from Address Book
For one of my PHP project, I have written a class to import contacts from Gmail and Hotmail address book and at the same time search in web for others email provider such as Gmail, Hotmail etc. to save my time. Then I found an excellent open source plugins to import contacts (address book) named…
Out of range value adjusted for column error
This is a known bug of MySql5 which I got while customizing one of my PHP projects. In the older version of MySql offered lots of freedom to developers. Previously anything can insert/modify into its tables but it does not seem to be practical anymore. No need to worry about the error. You can fix…
Most useful htaccess tips and tricks
An .htaccess is a simple file which is being detected and executed by Apache Web Server. You may need to CHMOD the .htaccess file to 644. This makes the file usable by the server, but prevents it from being read by a browser, which can seriously compromise your security. Always you have to place .htaccess…
Extract href links from a website content using regular expression
One of my previous post I have discussed about to Grab website content using cURL. In this post I have given a sample code snippet to extract all hyper links from grabbed content using regular expression. By using following class you can grab site content and extract all hyper links: class ScrapWebsite{ var $target_url =…