|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-11-02 20:12 UTC] phresno at concept-factory dot com
I'm not sure if this is a problem with constants and pre-registered globals, or the printing mechanism.
When setting up a constant such as this:
define("SELF", $SCRIPT_NAME);
and then printing with any of the following:
echo SELF;
print(SELF);
pritnf("%s", SELF);
The output is nothing, however, if I do this:
printf("%s", SELF . "?foo=bar");
it will print properly.
I believe it's a problem with the globals, as when I try just to print $SCRIPT_NAME or $SCRIPT_FILENAME I go no output unless I concat'ed it to something else such as shown above.
My PHP configuration is as such:
'./configure' '--with-apxs=/usr/sbin/apxs' '--disable-short-tags' '--enable-bcmath' '--with-zlib-dir=/usr/lib' '--enable-ftp' '--with-gd=/usr/local/gd-1.8.4' '--enable-gd-native-ttf' '--with-jpeg-dir=/usr/lib' '--with-png-dir=/usr/lib' '--enable-sockets' '--without-mysql' '--with-pgsql=/usr/local/pgsql'
On Slackware (8.0) Linux, Kernel 2.4.5, Apache 1.3.20. For this particular script, I was working with sessions, and DID use the following lines to disable some sessions settings:
ini_set("session.use_cookies", 0);
ini_set("session.use_trans_sid", 0);
The script was written prior to 4.2.2 and the auto enabled trans_sid was creating extra data in my GET's that I had already accounted for in my own script.
-Richard
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 10:00:02 2025 UTC |
Even with register_globals off, why does it sometimes print, and sometimes not? If it's not registering the global it should never print the contents of the global. Thus both: printf("%s", $SCRIPT_NAME); and printf("%s", $SCRIPT_NAME . "?foo=bar"); Should never print the contents of $SCRIPT_NAME, however, in the second instance, it prints the contents of $SCRIPT_NAME, even with register_globals off.