Home Blog Portfolio Development Contact Us Recommends
Building One Application at a Time

Archive for the ‘PHP’ Category

AJAX with OK status but still throwing error

Tuesday, March 2nd, 2010

Just a quick note to say AJAX can be tricky and difficult to debug on occasion. (more…)

SimpleXML Element and Session Variables

Monday, August 3rd, 2009

As you may have guessed, I am writing this because there is an issue with using SimpleXML and Session variables in conjunction with each other.  Sessions apparently do not know how to handle object resource values that the SimpleXML engine generates.  If you attempt to assign a Session variable to a SimpleXML object value you will get an error similar to this:

Warning: session_start() [function.session-start]: Node no longer exists

Here is an example of assigning the Session variable the “wrong way” (from Authorize.net CIM API):

$_SESSION['profileid'] = $this->results->customerProfileId;

And here is the correct way to assign the Session variable:

$_SESSION['profileid'] = (int)$this->results->customerProfileId;

If the expected data type of the object value is to be a string use (string)

That’s about it for now . . .

Using Pages to Hold Content for a Wordpress Template Page

Thursday, April 9th, 2009

I have been using pages to hold content in Wordpress templates for some time now.  The problem I have with it is that every time I need to perform such an action I cannot remember how to do it nor where I have done it before. (more…)

Checking If A Data Set Is Set When A Value Is NULL

Wednesday, February 25th, 2009

When setting a field in a MySQL database to be NULL by default you may run into NULL values in your dataset when querying the database.  You cannot simply check if a variable is set using the isset() function in PHP because it returns false for NULL values.  To remedy this issue you can use the array_key_exists(‘key’, $dataset) to check if the key exists in the array.

Good to know!

PHP Framework phpOpenFW

Tuesday, June 3rd, 2008

I never really thought about using a framework for PHP.  Mostly because I know PHP’s native functions well enough to create anything I needed from scratch.  The problem is time consumption with repetitive code and writing it out every time I needed it.
(more…)