I am developing a plugin. In the function call I want to load different PHP scripts. I tried using include("filename.php")
.
The scenario is that a function is called in PHP for an Ajax post method. In this function I want to load a PHP file.
Can anyone tell me how to get this to work?
Update – Got it working by using include(/folder1/filename.php) no need to specify the whole
path.
The syntax for file inclusion (either by
include()
orrequire()
) should be:if the file you want to include is in the same folder as your plugin’s main file.