Oscar Trelles
17Feb/040

PHP and Global Variables (Changing Servers)



I've changed servers over the weekend, and by now propagation should be complete. The funny thing is that for a moment in the afternoon, the site was apparently broken, since most of the rendering scripts weren't working. I got real worried for a while, until I found the answer: newer installations of PHP (4.2 and on) don't set environment variables as globals.

I have to be one of the worst organized coders around, although I try to make code look organized. The sad true is that most of the core scripts on my blog system were written in a very amateurish style, since I actually learned PHP programming when building this thing. then I patched it over an over again... and well, never took care of certain details, some times I'm just too lazy :)

So, this morning, instead of just turning register_globals back 'On', I decided to finally get dirty and fixed all my scripts to look for data in just the right places. I also took advantage of the situation and added a couple of features I wanted in the blog for a while now, like showing the number of times a post has been viewed; it will be useful later to keep track of the most popular posts, and stuff like that.

So, regarding the server changes, some may have experienced delays and/or 404 errors during this period. Also, if someone sent me an email and it got bounced back, I apologize for the inconvenience: I'm still here :)

Filed under: Uncategorized Leave a comment
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


No trackbacks yet.

Twitter

Recent

Pages

Categories

Archives

Flickr

669 Bergen St, Brooklyn, NY 11238, USA669 Bergen St, Brooklyn, NY 11238, USA669 Bergen St, Brooklyn, NY 11238, USA669 Bergen St, Brooklyn, NY 11238, USADouble cheese burgerDouble Rainbow