Apr 08, 2008
Laziness, MySQL inserts and updates
For a while I've been using a database class I wrote a while back. Over the past ten months that I've worked at gyro I have been shortening the function names and trying to make different functions so that the things that I had to type were as small as possible. I should probably dive into a framework to do this but I haven't had the time. So in my database class I c ...
Posted by Mark at 6:03 PM in PHP Tutorials | Link
Feb 29, 2008
Custom Directory Listing
The following code will give you an XHTML validating directory listing with icons for filenames that are easily customizable and easy to add more file types. You just need to come up with your own icons. An example can be found here and the full source code can be found here. First, in the body of your XHTML document declare some variables and then read the files f ...
Posted by Mark at 12:33 PM in PHP Tutorials | Link
Feb 19, 2008
PHP Source Highlighting
I wanted to customize the PHP highlight_string function so I could change the colors to fit this site. I figured I would share it with anyone who wanted to see it. /* @sources = code to highlight; @classes = boolean for using classes instead of inline styles */ function php_highlight($source, $classes = false) { if (version_compare( phpversion(), "5.0.0", "
Posted by Mark at 2:02 PM in PHP Tutorials | Link