Go Back   WarriorForum - Internet Marketing Forums > Warrior Support Forums > Programming Talk
Register Blogs FAQ Social Groups CalendarHelp Desk

Reply
 
LinkBack Thread Tools
Old 09-22-2009, 12:16 PM   #1
Active Warrior
 
Join Date: May 2009
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default PHP Global Variables

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   Reply With Quote
Old 09-22-2009, 12:27 PM   #2
Advanced Warrior
War Room Member
 
TristanPerry's Avatar
 
Join Date: Aug 2009
Location: Cardiff, United Kingdom
Posts: 772
Thanks: 171
Thanked 147 Times in 103 Posts
Social Networking View Member's FaceBook Profile  View Member's Twitter Profile  View Member's YouTube Profile
Default Re: PHP Global Variables

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)

"If you are clear where you are going and you take several steps in that direction every day, you eventually have to get there."
TristanPerry is offline   Reply With Quote
Old 09-22-2009, 01:25 PM   #3
Advanced Warrior
War Room Member
 
warrich's Avatar
 
Join Date: Sep 2009
Posts: 653
Thanks: 2
Thanked 27 Times in 24 Posts
Social Networking View Member's Twitter Profile  View Member's YouTube Profile
Contact Info
Send a message via Yahoo to warrich Send a message via Skype™ to warrich
Default Re: PHP Global Variables

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

warrich is offline   Reply With Quote
Old 09-28-2009, 02:24 AM   #4
Active Warrior
War Room Member
 
Join Date: Feb 2009
Posts: 50
Thanks: 2
Thanked 4 Times in 4 Posts
Lightbulb Re: PHP Global Variables

Look at:

Universally Accessible Data in PHP | EvanBot

PHP configuration patterns

cu Ludwig
LudwigReithofer is offline   Reply With Quote
Reply

  WarriorForum - Internet Marketing Forums > Warrior Support Forums > Programming Talk

Tags
global, php, variables

Thread Tools

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 05:31 PM.