GoDaddy, cURL, HTTP, and 403 Errors

I was recently coding PHP cURL functionality for a GoDaddy-hosted website and I kept running into an annoying 403 error. Essentially, GoDaddy’s proxy server (which they force you to use for cURL) was giving me a “Forbidden” error and wasn’t trying to hit the necessary server. Here’s the code that GoDaddy tells you to use for cURL transactions:

PHP, SSL, and cURL SSL3_GET_SERVER_CERTIFICATE Errors

I recently developed a complex system for a customer that involved PHP, cURL, and a SSL connection to a third party vendor. The third party vendor would validate the security certificate of the source (the system I created) and either allow or reject access. My code looked like this:

Download a URL’s Content Using PHP cURL

Downloading content at a specific URL is common practice on the internet, especially due to increased usage of web services and APIs offered by Amazon, Alexa, Digg, etc. PHP’s cURL library, which often comes with default shared hosting configurations, allows web developers to complete this task.

Simple PHP Caching and Content Retrieval Function

One way to make your website exponentially faster is by caching both remote and internal requests. Why request your RSS subscriber count from FeedBurner more than once a day if that count is calculated once per day? Why hit your database on each page load if that content rarely changes?

Caching AJAX Results in JavaScript


AJAX is an awesome tool. AJAX requests are usually faster than regular page loads and allow for a wealth of dynamism within a page. Unfortunately many people do not properly cache request information when they can. Let me show you how I cache AJAX requests — it’s super easy!

21 Really Useful & Handy PHP Code Snippets


PHP is the most widely used web based programming language that powers millions of websites including some of the most popular ones like Facebook. Here are 21 really useful and handy PHP code snippets that every type of PHP developer will find useful.

Retrieve Google Analytics Visits and PageViews with PHP

Google Analytics is an outstanding website analytics tool that gives you way more information about your website than you probably need. Better to get more than you want than not enough, right? 

Reading Excel Documents from PHP applications


In this article we will learn on how we can read Microsoft Excel Sheet in PHP. To achieve this we will be using Open Source Tool PHPExcelReader. It provides us with necessary API that allow us to read the Excel Sheet in PHP.

Retrieve Your Gmail Emails Using PHP and IMAP

Grabbing emails from your Gmail account using PHP is probably easier than you think. Armed with PHP and its IMAP extension, you can retrieve emails from your Gmail account in no time! Just for fun, I’ll be using the MooTools Fx.Accordion plugin to display each email.

Facebook type image rotation and more using PHP and Javascript

If you are a facebook geek like me, you must have noticed till now the image rotate functionality in the photo albums. Facebook allows you to rotate images 90 degree clockwise and anti-clockwise after image upload. If you haven’t tried that till now, below is a screenshot for your convenience.

AJAX User Poll Using jQuery and PHP


Today, we’ll be creating a nice user poll script using jQuery and PHP utilizing AJAX and animation effects of jQuery to spice up the user interface and provide a rich user experience. Let’s get started.

Multiple File Upload With Progress Bar Using php and jQuery


The default browser file input boxes do not allow multiple file selection for uploading at once and also do not provide any visual clue as to how much of the files selected have uploaded. Earlier I wrote about multiple file upload using AJAX, but that did not provide multiple file selection and a progress bar.

Open Source Human Resource Management System using PHP and Mysql

It’s of course built in PHP and runs a MySQL database so it’s all web based running on the apache server. It’s currently in version 2.3 as it’s latest production version. Here are the main features of OrangeHRM so you know a little more about it:

Inventory management system (IMS) using php and Mysql

Inventory Management Software: Having problems with keeping an accurate inventory? Web-based inventory management makes it easy to keep your inventory accurate from any location. This PHP/MySQL inventory management solution supports multiple users, and inventory transaction logging. 

Plotting line graph using PHP GD Support

Reading data from the mysql table To use line graph we are using data from mysql table. We will not discuss much on how to get data and there are many tutorials available here on how to connect and how to display data from the table. For our example we have taken table where monthly sales figure is stored. 

Getting technorati ranking in PHP without using their API


I was going through the Technorati API to find the rank of the blog using PHP. Those who doesn’t know about Technorati, Technorati is known as the authority for tracking, indexing and ranking the blog sytems. When I went through the Technorati Api, I found that it is not that hard to get the ranking of a blog which is indexed in Technorati.

Web Services and PHP – SOAP vs XML-RPC vs REST


In a typical web surfing scenario, a visitor visits a website and use the functionality provided by that particular website.HTTP request is send to server from web browsers and server responses are translated by browser to display the desired result of the visitor. 

Force download multiple files in a zip archive using PHP


I’ll show you how can you download the multiples files in a zip archive using PHP. I’ve made a function in PHP where you’ve to pass the parameters the array of files to be zipped, the second parameter is file name as which zip archive file has to be downloaded and finally the path of files where files to be zipped are located.(assuming that they are all in same folder).

6 free ajax chat applications using PHP


While talking about chat application, these days people hate those kind application made in PHP which need page refreshing. In this post, I’ll show you six different free Ajax chat applications which might be very useful if you’ve to use Ajax based chat application. 

Paging Using PHP and MySQL


When there's more than one column involved in paging there isn't much that we need to modify. We only need to decide how to count the total number of rows we have in the table. Consider the student table. This table have five columns as shown in the SQL below.

Finding PHP and MySQL Hosting


There are a lot of things to consider when choosing a web hosting company. But one thing for sure is that price is no longer important. Web hosting is a very competitive field so the price just keeps getting lower and lower. It is so easy to find cheap web hosting for PHP and MySQL.

Read HTML files using PHP



Reading an html file is just like reading any other file. You could use fopen() combined with fread() orfile_get_contents() or file() function. Here are some examples :

Executing a Shell Command Using PHP

You can use either system() or exec(). Just remember to ALWAYS use the full path to the command. So instead of entering 'top -n1' use '/usr/bin/top -n1'. So may also need to provide additional paramater to the command so it will run correctly as a background process. Using 'top' command as example again you need to add the '-b' parameter to make it run correctly like this '/usr/bin/top -b -n1'

List a Directory's Contents Using PHP


To list the content of a directory you just need to use the combination of opendir() and readdir() functions.

User Authentication with Image Verification using php


In some cases you may want your loging form to be able to prevent automatic login by a robot ( script ). To achieve this we can create a login form which displays an image showing random numbers. The login form will have an extra input field to enter the values shown.

Append a String to a File Using PHP

To append a string to a file you will need to open the file using fopen() with the 'a' parameter. For example if your log file name is mylog.txt you would write the code like this :

Content Management System ( CMS ) using PHP and MySQL


A Content Management System ( CMS ) is used to add, edit, and delete content on a website. For a small website, such as this, adding and deleting a page manually is fairly simple. But for a large website with lots of pages like a news website adding a page manually without a content management system can be a headache.

Http Client Class for PHP development


This class is designed to provide quick http reqest method to access external website. A CURL alternative to php native file_get_contents method. It can work without any configuration and can be called anywhere is your application using singleton design pattern. 

Convert a Multidimensional Array Into Single Dimension using php


I have wrapped three static functions for converting multidimensional configuration data. It is very much useful when working with configuration data. I have used this class in one of my project to store arbitrary configuration data just like windows registry data.

Free PHP Encryption Software

A software developer is faced with a potential troublesome issue. When all the programming is done, and it's time to distribute the actual program, the question arises: How do I protect my intellectual property from being misused, changed and sold by a potential user of my program? Of course there are Copyrights, but not all users might be aware or care about it.

Display random number in random way using JavaScript

I think you guys already know about how to get the random number using JavaScript, if you don’t know then you can use Math.random() to display a random no ranging from 0 to 1. It would have been better if we display the random number in the random way using JavaScript. Ok, Let’s do it..

Php function to validate two decimal places of a number


If you are looking for the validation of a number which contains only two decimal places. Means you want to accept the values like 0.21 or 1.34 or 12.55 or 445.66 as a input and throw an error when somebody enters the number like 0.2 or 4.678 from a text box. Here is a simple function for you in PHP which validates the number weather it contains exactly two decimal places or not.

Email address validation in PHP


you’ve been asking why this person has posted the same stuff which you can find easily in google. Ya you are right you can get lots of scripts but many of them are not useful for me so far. They just validate the email like “info@yahoo.com” but they didn’t validate the email address like “contact@roshanbh.com.np” or even the address like info@holmesglen.vic.edu.au“.