‘PHP Code’ Archive

praux.com API October 28, 2009 1 Comment

If you havn’t seen praux.com’s fancy API, you should definitely have a look. Here’s an interface I put together that uses the API to display praux-hosted resumes on your own site. Praux is a new site that allows you to assemble, maintain and share your resume with others. The REST design and [...]

GroupWise 6.5 to Zimbra AddressBook August 22, 2009 No Comments

Here is some code to translate a GroupWise 6.5 address book into a format that Zimbra can understand.

nab2zimbra.php

<?php
function get_value_by_mapi($zimbraid, $nabid,$nabvalues,$nabfields)
{
if ($nabid == "")
{
return "";
[...]

Switch vs. If January 27, 2008 6 Comments

Often, with little rhyme or reason behind it, I choose between using a switch condition or an if-else statement while coding simple condition matches in PHP. I got curious about which is actually more efficient at matching a random integer with a set of conditionals. So, I setup a script to create a set [...]

PHP and Solaris: getcwd() Behavior November 10, 2007 No Comments

The Solaris OS has implemented, for quite some time, a permission restriction with respect to when getcwd() will return a full/real path under certain conditions. This has at least been since SunOS 5.8 and continuing on into 5.10. Many functions within the PHP codebase relied upon a universally working getcwd() [C] call to [...]

Wapache – Win GUI Framework October 29, 2007 No Comments

Here is a project that deserves much more attention: http://wapache.sourceforge.net.
It is a modified Apache installation for Windows that links the power of apache (including PHP/Perl/etc. extensions) with the Windows GUI to create GUI windows applications simply and easily by way of custom apache Directives that link an Internet Explorer instance to the Windows GUI and [...]

Multipart Mime Headers in PHP September 16, 2007 No Comments

Here is a snippet of code that shows how multi-part mime headers can be assembled without the help of a mailer class.

<?
$mime_boundary=md5(time());
$headers .= ‘From: My Email <me@company.com>’ . "\n";
$headers .= ‘MIME-Version: 1.0′. "\n";
$headers .= "Content-Type: multipart/mixed; boundary=\"".$mime_boundary."\"". "\n";
 
$msg .= "–".$mime_boundary. "\n";
$msg .= "Content-Type: text/plain; charset=iso-8859-1". "\n";
$msg .= "Content-Transfer-Encoding: 7bit". "\n\n";
$msg .= $textmessage . "\n\n";
 
$msg [...]

Oracle Tree Relationships August 17, 2007 1 Comment

Working with parent-child relationships between rows in tables can be a headache to deal with, especially if you need to display those relationships graphically. However, Oracle provides some great constructs that make this much easier to deal with. Here are some of the challenges that I ran into and the solutions I came [...]

PHP: Find Ophaned Files August 16, 2007 No Comments

For a project at work, I needed a good way to find orphaned files (files that are not linked-to by anything) in a web directory. I looked for a good [free] application and could not find anything worthwhile except for a few windows applications. This PHP script searches recursively through an entire directory [...]