Include vs require

As the website you just started expands to have more than one page and a decent number of lines of code you will start feeling a tingling sensation on your finger tips. At first, you won’t know what it is. But as your website sprouts more and more pages and the number of lines . . . → Read More: Include vs require

Adding Facebook Like button to all pages

Adding the Facebook Like button to a page is easy enough visiting this link and generating the code needed. However, things are pretty different when you have a lot of dynamic pages or you want to add it for your whole site in one place, in some file that you include in your whole . . . → Read More: Adding Facebook Like button to all pages

Single quotations vs double quotations in PHP

Strings in PHP can be specified in four different ways: single quoted, double quoted, heredoc syntax and (since PHP 5.3.0) nowdoc syntax, the first two of them being by far the most frequently used.

When do we use single quotations, when do we use double quotations and which are the differences between them?

. . . → Read More: Single quotations vs double quotations in PHP

HTTP or HTTPS, find out if the page is secure in PHP

Any site involving sensitive information needs to have some of its pages only accessible via SSL. This is a way to make sure that your page is only available on https, using the predefined variable $_SERVER['HTTPS'] to determine the connection and $_SERVER['SERVER_NAME'] and $_SERVER['REQUEST_URI'] to rebuild the accessed url:

1 2 3 4 5 . . . → Read More: HTTP or HTTPS, find out if the page is secure in PHP

Retrieve and display latest tweets

With all this social networking hype, many sites display their latest tweets on their pages. Here’s a simple method to display your latest tweets from PHP:

Let’s assume your twitter username is “mytwittername”. You can retrieve your latest tweets in XML format at the following address:

http://twitter.com/statuses/user_timeline/mytwittername.xml

replacing mytwittername with your username. By default, . . . → Read More: Retrieve and display latest tweets

Categories

Archives

Calendar

May 2012
M T W T F S S
« May    
 123456
78910111213
14151617181920
21222324252627
28293031