Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 22nd Sep 2009, 11:16 AM   #1
Active Warrior
 
Join Date: 2009
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default
PHP Global Variables
Share on: 
fb share twitter share gplus share more share

I'm developing an e-commerce site involved with a lot of database access and naturally I want to keep the DB access to a minimum. Keeping some information in a server buffer definitely helps. I do have about 10 PHP script files for the entire site. Do you know if variables declared outside of functions in PHP modules are considered as global variables and accessible from any executing PHP scripts? Thanks,


Warren
WarrenW is offline  
Unread 22nd Sep 2009, 11:27 AM   #2
Advanced Warrior
War Room Member
 
TristanPerry's Avatar
 
Join Date: 2009
Location: Cardiff, United Kingdom
Posts: 760
Thanks: 159
Thanked 144 Times in 99 Posts
Default
Re: PHP Global Variables
Share on: 
fb share twitter share gplus share more share

If they are declared outside any functions or loops then yes, they'd be considered as global vars and could be used anywhere (as far as I know)

Plagiarism Guard - Protect Against Content Theft
TristanPerry is offline  
Unread 22nd Sep 2009, 12:25 PM   #3
Advanced Warrior
War Room Member
 
warrich's Avatar
 
Join Date: 2009
Posts: 772
Thanks: 4
Thanked 38 Times in 31 Posts
Default
Re: PHP Global Variables
Share on: 
fb share twitter share gplus share more share

you can use php.ini in your root directive to override server php.ini setting not sure about my.cnf file

warrich is offline  
Unread 28th Sep 2009, 01:24 AM   #4
Active Warrior
War Room Member
 
Join Date: 2009
Posts: 71
Thanks: 2
Thanked 6 Times in 5 Posts
Lightbulb
Re: PHP Global Variables
Share on: 
fb share twitter share gplus share more share

Look at:

Universally Accessible Data in PHP | EvanBot

PHP configuration patterns

cu Ludwig
LudwigReithofer is offline  
Closed Thread


Bookmarks

Tags
global, php, variables


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 10:39 PM.