Posts Tagged ‘PHP’
Posted on August 18, 2010 - by webmaster
PHP Newbie: Proper handling of Error & Exception in PHP
Got a question from a friend today who is actually a great desktop programmer and just learn PHP since he believe that the future is in the web (hope you’re right dude). He asked me about how to handling error in PHP. Well i’ll write my answer here so can share with others and got feedback when I was wrong.
In PHP there are few options that you can use to handle errors & exceptions during script executions and as developer you must considering not the easiet but the most flexible approach which will help you when debugging your appllication, the more detail error message provided the faster you can fix it. Flexible means its easy for you to change the application behaviour when unexpected things happened during execution like: display error, logging error or even automatically notice you via email.
Posted on June 27, 2010 - by webmaster
Install, Configure & Running Memcache in Windows as Service
Installing memcache server in windows is a little bit complicated compared to how it can be done in *nix since theres not yet available ready to use package for win32.
Luckily i found the compiled memcached for win32 (exe) which was made by jellycan, within this exe file you can install configure and running memcached as a service in your windows environment, here are how i made it:
*** updated ****
Newer version available at northscale, thanks to Matt Ingenthron for pointing this.
Posted on June 6, 2010 - by webmaster
Upgrading to upcoming CodeIgniter 2.0
phil sturgeon has published a new article in his blog about upgrading pyroCMS to the new upcoming codeigniter 2.0, worth to look at to help you port your CI based application to run with CodeIgniter 2.0 with less headbanging. I seen big changes has been made to this new version includes:
(more…)
Posted on September 24, 2009 - by webmaster
PHP Class Create Short URL via TinyURL, Is.gd, Hex.io, Tr.im & Bit.ly API
Short URL is commonly used today for several reasons: avoid url garbling, take smallest space especially for long url which need to be posted at limited space format eg: twitter, also often used to manipulate user for specific purposes eg: hiding orginal url for phising and ads/affiliation links.
There are many websites that provide shortening url services, tinyurl, bit.ly, hex.io are some of them, below is simple PHP script as an implementation to use their API, create short url on the fly, currently support: tinyURL, bit.ly, is.gd, tr.im and hex.io, but you can easily add other providers.
Posted on February 7, 2009 - by webmaster
PHP Currency Converter via Yahoo Finance
I have posted sample of PHP script to do rate conversion based on Google Finance rates, now this is the same PHP functionality but based on Yahoo Finance rates.
Posted on February 6, 2009 - by webmaster
PHP Currency Converter via Google Finance
Today i am working on a site which need a currency converter, first thing that come up in my mind is google widget, but then i stuck in customizing it to match the design and i decided to fetch it manually, and here is the PHP codes:
(more…)
Posted on September 7, 2008 - by webmaster
Use custom fonts, PHP, DOM & Javascript Image Replacements

Using custom fonts sometimes can give a different “soul” to the web page, but as a good web designer we shouldnt fully strict to the “looks & feels” but also the accessibility, cross compatibility, always try to make it present almost in the same way across different screen readers, browsers, and media. now days we also need to consider of SEO, and use image directly to the page to replace the important phrases is not a best practice.
Posted on September 5, 2008 - by webmaster
pChart an opensource PHP GD charting framework

pChart is an opensource PHP chart framework, it is provides ability to render a chart using PHP + GD Library easily. It also comes with pCache which enables caching the data and save the load of server, released under GNU GPL license.
Posted on August 17, 2008 - by webmaster
PHP ajax login form using Jquery

Because a lot of responses to the previous post php ajax tutorial create ajax based login form using jquery, and asking about some bug fixxing incl IE bugs, i decide to create a new PHP ajax login functionality using Jquery, and here it is…
Whats new?
- Completely recoded
- Tested in IE6, FF3, Opera9 and i think should be worked in other modern browsers as well
- Easliy switch the data source between database and PHP array
- Login authentication can be using username or email, or even both of ‘em by changing the config
- Automattic redirection could be done within the javascript config
- Redirect target (on success) can be changed in config file
- Message and Text controled by array variable which could be changed in 1 file

Posted on August 16, 2008 - by webmaster
Is there a secret behind file encoding in PHP?
Today i faced a strange warning message when executing a PHP file,
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at file.php:1) in file.php on line 15
Well not the error message, but the reason that produce this message, i have tried to use different solutions to avoid this error:
- Put the session_start() command in the very first line
- Explicit set of session_save_path
- Change the permission (CHMOD 777)
- Reset the php.ini session auto start + Explicit set on the codes
but none of ‘em fix the error. Then i try to use unusual test, changing the file encoding from UTF-8 (i always save my file in UTF-8 encoding) to ANSI, and Booom! the error message gone
.
Didnt really know how the file encoding can cause this error, because i always use UTF-8 and produce the same code and never get this error. Is there any secret of file encoding on PHP?, now you tell me
, because within ANSI i could not produce foregin characters, so i need a better solutions, to kiss this error away and keep the UTF-8 encoding.
Any suggestions guys?

