]> Something Witty Goes Here

codedread

Archive for the ‘PHP’ Category

Microblogging Floo-Flah

Thursday, July 10th, 2008

Despite my best intentions and my inner voice crying out “microblogging is stupid!”, I’ve been slowly sucked into it. It started innocently enough with the Facebook status. Then I joined the party over at Twitter just to see what all the hubbub was about. When I learned about identi.ca, I decided to check that out a couple days ago (more and more people are joining there now).

The problem, of course, is that not everyone is on the same social network. And you might not want to be on any of the social networks that I’m on. Or you might not trust any of those companies. Enter ping.fm. Click To Read More...

Inlaying SVG with HTML

Friday, January 13th, 2006

After Rob called my code ugly, I decided to update my technique for embedding SVG into HTML and it finally crystallized into a nice solution for me. I hesitate to say “embedding” because that might imply that I condone the <embed> tag, when in fact I only use it at gunpoint. Rob came up with a suitable term for including SVG in a HTML document: inlaying (as opposed to inlining). Click To Read More...

Deploying For The Live Web

Tuesday, May 24th, 2005

I’ve been pecking a way at this online chat program that I started as an excuse to learn some JavaScript and enhance my PHP skills (as well as get around a certain corporate firewall). It’s coming along nicely. Tonight I added a RSS feed for it so that users can monitor the most recent conversation without having to be constantly logged in. I’ve been trying to figure out a good way to manage the deployment of the web application. Click To Read More...

PHP Gotcha

Saturday, April 23rd, 2005

After I wrote this entry, I knew I had forgotten one “gotcha” from my little Remote Scripting experience. I remembered it today. It involves PHP and the annoying aspect of having to declare within a function when you want to use a global variable:

$gSomeVariable = 5;
function somefunc() {
   printf(”%d”, gSomeVariable);
}

The above will not produce “5″. Without explicitly telling PHP that gSomeVariable is a global variable, it will assume it is a local variable and currently undefined.

Do you know how many time this has tripped me up? The correct PHP code is:

$gSomeVariable = 5;
function somefunc() {
   global $gSomeVariable;
   printf(”%d”, gSomeVariable);
}

For all the times I made this mistake: AAAAAARRRRRGGGGHHHH!!!!!!!

codedread codedread