Requirements Testing

xajax - PHP Notices/Warnings

Today we were playing with xajax trying to eliminate some redundant page reloads and also keeps some divs hidden based on user input without having to manage their state.  All was working as expected on our Linux box (Fedora) but when we tried to get it running on IIS it was dying.  It looked like no response or anything was coming back from some simple AJAX calls.  So we did as every good web developer should do - bust out FireBug.  Looking at the NET results we noticed we were in fact getting a response from our request but with an additional “PHP Notice undeclared variable message” (not show in the pic). It didn’t really dawn on us that this was the culprit until we opened IE 7 and it returned with a dialog box saying it could not parse the XML because of a space, pointing out the “Notice” message was returned before the XML response.  A closer look at our PHP.ini file resulted in use turning off Notices and turning on Errors only.  This was the issue.  Goes to show you having two browsers for debugging is a good thing :)

image

Written by Tim on June 25th, 2007 with 5 comments.
Read more articles on php and web 2.0 ish.



Related articles

5 comments

Read the comments left by other users below, or:

Get your own gravatar by visiting gravatar.com John
#1. June 26th, 2007, at 2:06 AM.

Actually a good developer doesn’t have to debug his code.

Get your own gravatar by visiting gravatar.com Tim
#2. June 26th, 2007, at 1:06 PM.

Good developer? Oh no I just get things done :)

Trackback Mention from Ingain.org
#3. November 2nd, 2007, at 10:44 AM.

Web Hosting Providers Directory: Web Hosting Providers Directory... Sorry, it just sounds like a crazy idea for me :)...

Get your own gravatar by visiting gravatar.com Kevon K. Hayes
#4. December 15th, 2007, at 6:54 PM.

This may help to silence notices: When declaring vars that you know wont always be initialized put an ampersand in front of that var. i.e.

Get your own gravatar by visiting gravatar.com Kevon K. Hayes
#5. December 15th, 2007, at 7:16 PM.

This may help to silence notices: When declaring vars dynamically that wont always be initialized put an ampersand in front of that var.
e.g.

$someVar = “some Dynamic Content”
@$someVar // this will rid notices

BUILD IT! (Encouraging all to Build there Goals, Hopes, and Dreams)

Leave your comment...

If you want to leave your comment on this article, simply fill out the next form:




You can use these XHTML tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong> .