Thanks Jack
arcad.
Jack Dempsey [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
you have to use $GLOBALS[SCRIPT_FILENAME]
jack
Arcadius A. wrote:
Hello !
Why this script prints an empty string(it prints nothing) as the
value of
the variable u
So sprach »Arcadius A.« am 2001-08-31 um 05:27:04 -0700 :
$u = $SCRIPT_FILENAME;
Because you did not define $SCRIPT_FILENAME anywhere. If you want to
access the global variable, you've got to say so:
global $SCRIPT_FILENAME;
Alexander Skwar
--
How to quote: http://learn.to/quote (german)
So sprach »Arcadius A.« am 2001-08-31 um 05:27:04 -0700 :
$u = $SCRIPT_FILENAME;
Because you did not define $SCRIPT_FILENAME anywhere. If you want to
access the global variable, you've got to say so:
global $SCRIPT_FILENAME;
Or, so you don't have to specify all the variables you are
So sprach »Boget, Chris« am 2001-08-31 um 10:04:49 -0500 :
Or, so you don't have to specify all the variables you are using
as globals (especially if you are using *alot* of them), you can
use:
$GLOBALS[SCRIPT_FILENAME];
What's the gain? 'global ' has 7 characters, whereas '$GLOBALS[]'
Or, so you don't have to specify all the variables you are using
as globals (especially if you are using *alot* of them), you can
use:
$GLOBALS[SCRIPT_FILENAME];
What's the gain? 'global ' has 7 characters, whereas '$GLOBALS[]' has
10 characters. So, you don't type less. And with
RE: [PHP] PHP_SELF or REQUEST_URI within Function ?Ok Men !!!. Now I see
thanks alot for the inputs ! :o))
Arcad
- Original Message -
From: Boget, Chris
To: 'Alexander Skwar'
Cc: Arcadius A. ; [EMAIL PROTECTED]
Sent: Friday, August 31, 2001 8:22 AM
Subject: RE
So sprach »Boget, Chris« am 2001-08-31 um 10:22:28 -0500 :
True. But take the following function:
function processLotsOfFormVars() {
global $fieldOne, $fieldTwo, $fieldThree, $fieldFour;
global $fieldFive, $fieldSix, $fieldSeven;
global $PHP_SELF, $REQUEST_URI;
global
One of the downside of PHP IMHO is, that you do not have to define
variables. This leads to a lot of errors. At least there should be a
option, which forces you to define variables, like maybe so:
dim $some_var;
I definitely agree there. I've been bitten by this bug more times
than
Message -
From: Alexander Skwar [EMAIL PROTECTED]
To: Boget, Chris [EMAIL PROTECTED]
Cc: Arcadius A. [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Friday, August 31, 2001 8:21 AM
Subject: Re: [PHP] PHP_SELF or REQUEST_URI within Function ?
So sprach »Boget, Chris« am 2001-08-31 um 10:22:28 -0500
Cool ...
Now that we're talking about PHP
I'd like to ask a question
You know the overloading function in C++ Is that
possible in PHP ?
No, I do not believe so.
Basically , I'd like to define more than one function having
the same name but different number of
One of the downside of PHP IMHO is, that you do not have to define
variables. This leads to a lot of errors. At least there should be a
option, which forces you to define variables, like maybe so:
I've not followed this thread but this is pretty much what E_NOTICE is
for, turn it on in
Ok .I see Thanks to you both !
Have a nice weekend
Arcad
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
So sprach »Arcadius A.« am 2001-08-31 um 17:36:51 -0700 :
Would this work ?
Kinda, but not really.
If you want to do this, you've got to stuff it all in one function, like
so:
function dunno($mandatory, $optional1 = NULL, $opt2 = NULL){
if (NULL === $optional1){
//
you have to use $GLOBALS[SCRIPT_FILENAME]
jack
Arcadius A. wrote:
Hello !
Why this script prints an empty string(it prints nothing) as the value of
the variable u ?
This happens even if $REQUEST_URI or PHP_SELF is used instead of
SCRIPT_FILENAME .
Thanks...
?
function menu(
?
function menu( $theurl)
{
//global $u ;
$u = $SCRIPT_FILENAME;
echo $u;
echo $theurl;
}
?
Hello there !!!
? menu(hoho.com) ?
Variable scope.
You need a global $SCRIPT_FILENAME; at the top of the function.
Jason
--
PHP General Mailing List (http://www.php.net/)
To
15 matches
Mail list logo