Issue with include_once()
-
I’m having a problem with the include_once() function. I am currently using the Ahimsa theme and have placed myfile.php in the ahimsa folder. Then in ahimsa’s entry.php file, I added the following to attempt to use the code from myfile.php:
if(trim(wp_title("", false)) == "myfile") { include_once("myfile.php"); echo "got myfile.php"; }
The “got myfile.php” output appears on the correct page just fine, but for some reason the contents of myfile.php appear to be from an older version of the file, which displays the text “This is myfile.php” and a list of $_GET keys and values. I changed the contents of myfile.php to a simple echo statement, but the output didn’t change. I don’t know how it happened, since the version of the file it appears to be outputting was never in the folder. I even created a new file, named it myfile.php, pasted the contents into the new file and placed it in the ahimsa folder, but the problem still persists.
I’m not sure if it’s important, but I am currently using an offline local site on a computer running Ubuntu.
Thanks for the help!
- The topic ‘Issue with include_once()’ is closed to new replies.