predefined variable scope

From: Date: Mon, 26 Jun 2000 07:21:23 +0000
Subject: predefined variable scope
Groups: php.general 
Request: Send a blank email to php-general+get-3078@lists.php.net to get a copy of this message
I'm having an issue with variable scope that I'm not able to find in the docs (which probably just means I'm looking in the wrong place). I have a file with all of my standard stuff in it (colors, email addresses, etc.) called "std-defines.inc." All of the pages on my site 'require()' it. In std-defines.inc, I have defined a function exit_with_errors(). I call this function anywhere in the page that I run into a problem. It prints out formatted error text and does some basic cleanup. I recently added a bit to send email to me whenever the function is called (it should be a rare occurrence). I hoped to have it include basic info about the request (QUERY_STRING, HTTP_REFERER, SCRIPT_NAME, etc.) in the email. But these variables seem to be undefined in exit_with_errors(). Since I can successfully print them directly from the source file, I assume this is an problem with the scope of those variables. Is there some way that I can make those predefined variables available to functions in my .inc files without just passing them as function arguments? Thanks. sean -- Sean Harding sharding@dogcow.org |"Telling you the truth http://www.dogcow.org/sean/ | has made you change." | --The Nields

« previous php.general (#3078) next »