Re: Re: Plugins... (like wordpress?)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



there is two way you can do this (there is more). using the function
include()
to include files based on query string or using call_user_func()

you can keep all the files/modules in one folder.
pass the module reference using GET.
from the GET we can determine which function we want to call using include()

or call_user_func()

be careful, do not pass the filename for the include because it used to be
some security problem. you can do an array instead

$modules['gallery'] = 'gallery.php'; //gallery.php is filename

so we can pass the modules to the program as eg: www.domain.com/?mod=gallery
then do

include($module[$_GET['mod']]);
you can use file_exists() function to determine the file actually exist
prior to the include()..

good luck..

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux