How to use curl to Query Remote Servers

Curl is very useful to connect to a remote server and get required data.As with all other full featured browsers curl has support for proxies. Proxy servers are buffers between the requesting client and the web server. Proxy servers are used for a variety of reasons including companies restricting web access to people wanting to appear anonymous.

There are a few curl options to set when using a proxy. First to enable use of a proxy in curl use the option CURLOPT_HTTPPROXYTUNNEL. Second set the proxy with the option CURLOPT_PROXY. If you need to set authentication information use the option CURLOPT_PROXYUSERPWD. CURLOPT_PROXYUSERPWD expects a string in the format of user:password. HTTP proxies are default, to use a SOCKS proxy use the CURLOPT_PROXYTYPE option.

Read the rest of this entry »

How to run code of php5 on a server with php4 using htaccess

This is big question for beginners every time.Now as we know that php5 is in full flow but still there are lot of servers out there with php4 and if you upload your php5 code on those servers then it will be mess.May be your site will not run or any part or your will go down.But don’t worry friends , there are only 2 lines to put this problem far from you.
Just put these 2 lines below in a htaccess file and put that htaccess at the root directory.

AddHandler x-httpd-php5 .php
AddHandler x-httpd-php .php4

Now all the modules either they have written in php4 or php5 will work very well.

Calculating USPS Shipping Rates with PHP

If you have a custom shopping cart and you want to calculate actual shipping rates from USPS this is the post for you. I hope that by the end of this post you will have an understanding of the process and you can begin implementing USPS rates in your own website.

You may wish to grab a copy of the USPS Rates Manual for yourself.

Read the rest of this entry »