We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

require_once() statement | Forum

Rahul verma
Rahul verma May 4 '13
i want to do some task on my website 

for it i need to use require_once() statement for all pages.


may i know where i should add it to make it work globally

example :- 

i added it in index.php but it only worked with index page , not worked with all pages ..


Daisy Team
Daisy May 15 '13
If you added the  require_once() statement into the index.php file - this should effect all your site pages.
Rahul verma
Rahul verma May 15 '13
tnx daisy i am making a plugin actually .. and it need that condition.. is it possible to put require_once() automaticly via plugin install page .. so user doesn't have to put it by himself?


i know its a stupid question to ask here .. but i am new to plugin development 

Daisy Team
Daisy May 17 '13
Rahul, a plugin cannot make a changes in the index.php file. If you want something to be included into the index.php file you should create an init.php file for your plugin and add all nesessary functions into this file.
This file will be executed every time your plugin is active.

Please see the crash course for more information here: http://docs.oxwall.org/dev:crash-course