Re: Re: Plugins... (like wordpress?)
| From: | paragasu | Date: | Fri, 16 May 2008 11:21:48 +0000 |
| Subject: | Re: Re: Plugins... (like wordpress?) | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-274414@lists.php.net to get a copy of this message | ||
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..