Topics About Php

Jun 07, 2009 PHP5 GD Error: libt1.so.5: cannot open shared object file

Do you have GD and the PHP GD extension installed and yet it's not getting loaded into your PHP? If you getting the following error logged to your php error log, then the source of the problem is simple.

Oct 21, 2008 Shorthand PHP IF statement without the else notation

Shorthand PHP IF statement without the else notation In an earlier post I explained how to do Ternary shorthand if/else statements in PHP. One of the major benefits of using a shorthand if/else statement is that you can use it inline with a string. But what if you only need to do in inline if statement, without the else?

Oct 19, 2008 How to fix var-use-before-def-global PHP5 error within included files

How to fix var-use-before-def-global PHP5 error within included files If you make use of the code analyzer available in many modern IDE environments when coding strictly to PHP5 standards, you may have noticed that you will get errors thrown at you for using variables before they are declared in included files. For example, lets say you have two files, header.php and index.php.

Oct 06, 2008 How to grab thumbnails for youtube and google video

How to grab thumbnails for youtube and google video Today I modified my blog topic listing layout from just a simple link list to a more traditional blog style with a summary for each topic. It was a major improvement but I felt that it was a little too bland and decided that thumbnails of the videos and images contained within each topic would make it more appealing.

Feb 06, 2008 How to select previous/next rows in MySql

I decided to add the previous post & next post navigational links that you see at the top of this page for more internal cross-links as well as an easier means to browse posts. I went to type up the code really quick and had a temporary "coding block." So naturally I check google for a quick answer and found a few results of people asking for the same thing but no posted solution that I could see.

Feb 05, 2008 Regular Expressions cheat sheets

Regular Expressions cheat sheets No matter what languages you program in, chances are you have uses for regular expressions. Even though they comprise of only simple operators and switches, it can can be very tough to memorize how to properly harness the power of regular expressions. This is where these cheat sheets come in handy!

Feb 03, 2008 Temporary failure in name resolution in PHP script

This error popped on one of my clients website and it got me stumped. Through SSH, the DNS seemed to work fine. I could run host domain.com, curl, wget, etc - but when php would try to load the url, it failed with the above error. I tried setting different DNS resolver servers, restarted services, and checked for config errors but could not find the source of this problem. So I then turned to google.

Jan 27, 2008 Passing variable values in the url with php

In PHP you have the ability to pass information between pages through the URL. This technique is extremely simple and great for things such as telling a script what bit of information is needs to load (example: a forum topic).

Jan 10, 2008 Ternary PHP short-hand IF/Else statement

Any programmer will agree that the IF/ELSE statements are a fundamental part of any language. The basic syntax is pretty universal between languages but many dont realise that there is a shorthand version that allows switching to be done inline.