May 5th, 2011, 9:02 AM
Hi Crunchers,
Yeah, I had the same thought! In fact, I did something like that on another script of mine for a while. But I got burned by it: the SCRIPT_NAME and some other commonly available $_SERVER contents weren't being doled up on a particular the server. According to the PHP specs, technically they may not be available. Chances are it was just an anomaly, but it's made me nervous about relying on it.
Eventually, what I'll do is examine the way other popular PHP scripts (like Wordpress, Drupal etc) are doing it these days. If I *can* do away with having those variables set, that would be terrific.
- Ben
Yeah, I had the same thought! In fact, I did something like that on another script of mine for a while. But I got burned by it: the SCRIPT_NAME and some other commonly available $_SERVER contents weren't being doled up on a particular the server. According to the PHP specs, technically they may not be available. Chances are it was just an anomaly, but it's made me nervous about relying on it.
Eventually, what I'll do is examine the way other popular PHP scripts (like Wordpress, Drupal etc) are doing it these days. If I *can* do away with having those variables set, that would be terrific.
- Ben