Archive for the PHP Category
How to avoid fatal error Cannot redeclare function in PHP
This is for the programmers who are using functions to drive a website in PHP or there are some instances when you are using a common file which has some utility functions in it. In this kind of scenario the same file loops around on different pages and there exists this "Fatal error: Cannot redecla
Read Full PostShow Google talk status on your website
Hey People, Always wondered what could be the API which lets you interact with Google Talk ? Well I guess there isn’t one yet other than just creating bots. But what if you want to show the current Google Talk or GTalk status on your website or want it to use somewhere else like updating on twi
Read Full PostSend multiple direct messages on twitter
Howdy People, You have already learnt “How to update your twitter status ?” and also learnt how to interact with twitpic API to successfully upload images. Today I am going to show you how you can send direct message on twitter using the Twitter API and PHP. This piece of code will allow you
Read Full PostChange default php.ini values using .htaccess
Hey Folks, As you might be knowing that php.ini is the configuration file for the PHP and resides at the server. It contains all the options/settings for the PHP language. There are instances you need to change these options. In local environment you can change these settings very easily b
Read Full PostCheck username availability and validation using ajax,php
So you are creating a signup form and you want to create a fancy looking username validation Ajax script. I know that looks fancy when you signup for Gmail or Yahoo mailbox, instead these kind of validation are now on every signup form. We are going to create this simple script using Javascript, A
Read Full PostMagic methods in PHP
PHP has lot of magic stored in it. Magic methods in PHP is one way to witness it. These methods are executed automatically on certain event or situation. The function names __construct, __destruct, __get, __set etc are known as magic methods in PHP classes. That means these function names are reserv
Read Full PostHow to shorten and get stats of a URL from bit.ly API using PHP
Hey Geeks, So in the era of shortening URLs you lost the track what users are coming from where and what is the original source of traffic. Well there is nothing to worry since bit.ly keeps track of all your URL which are shortened by its API. Bit.ly not only shortens the long URL of your webpage
Read Full PostPost pictures on twitpic API using PHP
Hey Folks, In this post we are going to learn, How you can post picture to twitpic.com using the API services provided. It is very simple to send request to the API and post the picture on twitpic. You can also specify if you want to tweet about the picture to your twitter's timeline or no. The f
Read Full PostSend binary data using curl php
In this post , you will learn how you can send binary data through cURL in php. You might want to send binary data like image in some of the API calls viz Picasa API, Twitpic API etc. If you send the image file as it is, it will passed to the API request as passed over the http, using content-type
Read Full PostDynamically display twitter display image of a user
You might have wondered as to how a blog or a web-page displays you twitter image when you leave a comment there ? Well there is no rocket science involved in it and I planned why not create a small class for you through which you can show off little extra of your twitter love to the visitors. We
Read Full PostGet data from a URL using cURL PHP
Hey Folks, There are times when you need to fetch data from certain URL. This URL can give you RSS feeds or it can be a JSON data. But while writing a script you may often face challenge to fetch the contents from the URL. Some programmers use file_get_contents() function of PHP to get the data f
Read Full PostWrap text when creating images on the fly in php
Hey People, Wonder how could you insert line breaks, or make your string wrappable when you are creating images on the fly in php. I bet before you hopped in here, you must have tried inserting \n,\r,<br> using function wordwrap(); However its slightly different and the strings on images a
Read Full Post