Humberto S Ahumada
|
Posted: 10/12/2003, 2:04 PM |
|
I have designed and developed several applications where my global variables are the basis for all of my segregated queries and places to edit information relevant to the logged user. I have been using the UserID and GroupID variables for about 90% of my queries and edit pages. Now that my ISP provider has upgraded the PHP version to the newest version, all of my global variables do not work. Does anyone have a solution for global variables in the new version of php? I have tried Andrew’s suggestion on this link http://www.gotocode.com/disc_viewt.asp?mid=18256&s_topi...obal+variables& and still not luck. What is the work around this? I must find a solution before they update other servers where I have several applications for clients that will get very upset if the applications stop working properly…. HELP PLEASEEEEEEEEEEEEEEE!!!!!!!!!!!!!!!!
|
|
|
Sixto
|
Posted: 10/12/2003, 6:43 PM |
|
You can try adding this line to an .htaccess file (create it if not already there):
php_flag register_globals off
This may or may not work, depending on your host's Apache config.
Another way, is to always bring the variables to the global scope by adding the global statatement to your Common.php file e.g.:
global $UserID;
global $GroupID;
Now, if you are trying to use the sessions variable set by CCS, then replace all instances of the variables (in your code) with:
$_SESSION["UserID"]
$_SESSION["GroupID"]
Or, you can get the whole session variable block to the current context with:
extract($_SESSION);
You need to add this instruction as the last line in your Common.php file (just before ?>) or below session_start();
Regards,
Sixto
|
|
|
RonB
|
Posted: 10/13/2003, 4:05 PM |
|
click on the project name and in the toolbox set "use super global"to yes. Regenerate the site and re-publish.
Ron
|
|
|
BK
|
Posted: 10/14/2003, 10:52 AM |
|
Ron thank you for that feature in CCS. I have been learning CCS and the one thing I didn't like was manually changing the common file(PHP) to reflect the new global variable settings.
It worked great changin the setting in the project file.
Thanks,
BK
|
|
|
Humberto S Ahumada
|
Posted: 10/17/2003, 5:26 PM |
|
I have tried all suggested methos and I am not able to get the CCGetSession("GroupID") to pull the global variable and do group authentication. Any more recommendations that might be of help?
Best Regards,
Humberto
|
|
|
|