AFAIK the best way to tell if you're in ISAPI "mode" is to look at what server you're using. If you're using a Microsoft server (IIS or PWS) you'll undoubtedly have the ISAPI module installed. So the only way to change it would be to switch servers. If, that is, I read your question correctly.
I imagine you've checked the php installation using php_info() to see if register_globals is 'on' or 'off'.
If you don't have control over your php installation (access to the php.ini file) there are work-arounds. BUT, read and take to heart the reasons why register_globals now defaults to "off". Get both here [php.net].
I'm sorry madcat, I mislead you. You wouldn't have to "switch servers" to change from ISAPI to CGI. But you would have to re-install the server to reset the option. Somewhat the same. More here [php.net].
Thanks for the info- I'm using Apache and it's all local. Is it better or worse to extract env variable values using getenv(); or $_SERVER; -- $_SERVER works and I'm tempted to use it when getting these variables unless that's a bad way to move? Any thoughts?
The book you're using was written before the release of PHP 4.2, and it seems you're using an up-to-date installation of PHP. So either adjust the sample code in your book to reflect a setting of register_globals=off, or change the setting in your php.ini file to register_globals=on.
Used locally you don't have the security concerns of a networked situation but bear in mind that if you have any notion of using your code online you may have to rewrite it to suit the host's setup and your clients' needs/desires.
>better or worse?
In the long run it's best to go with the flow and get used to writing scripts with register_globals "off".
There are two ways the PHP engine may run: as a standalone executable that is called whenever a PHP script needs to be executed or as module within the server process. In the former case server and the PHP binary communicate via the Common Gateway Interface. In the latter case they communicat via the server api.
You simply need to decide which way you want to set up your server. Using mod_php is the recommended way. BTW you might not want to refer to ISAPI, which is the Internet Server Application Programming Interface when you are talking about the Apache webserver.
In PHP 4.1 and later the recommended way to access predefined variables is by using the autoglobal associative arrays. I see no need to use getenv() anymore.