For security reasons, display_errors should be turned off in php.ini. This will not display the error on the browser.
However it’s inconvenient during development not being able to see the error and have to access error logs. This can be turned on with this code:
error_reporting(E_ALL &&; ~E_NOTICE && E_WARNING);
This code should be removed / commented when put in production.
If you don’t want to use any standard CMS package and want to write your own, read this how-to post .
SMF also provides integration hooks where you can write your own functions without modifying the code. read this guide .
My biggest nightmare working on web development projects is trying to come up with a good color scheme for the site. I’m never a designer and I’m colorblind when it comes to this.
At work the graphic designer does the job, But when I’m on my own, I rely on this web-based color scheme generator.
Just select a color on the color wheel, click here and there, you can get some good color combinations out of it.
This is still my favorite tool and i just discovered it has a new version – a better interface with sample site preview.
A general php code to download any type of file:
header("Content-Length: " . filesize($filename));
header("Content-Disposition: attachment; filename=\"$filename\"");
content-type defines the type of file being sent. application/octet-stream is used for any kind of files.
content-length indicates the size of information. this is to let browser know how much data to download in advance and ensure
content-disposition is used to suggest the file name to be saved. the filename should have the correct extension so that the browser knows the default application associated with this extension.