PHP Include Issue
-
I’m having some problems with my php include via url specification.
The way I have it setup is with
<?php if(!isset($go)) { $go = ‘root’; } ?>
in the header and
<? include($go.”.inc”); ?>
somewhere in the middle of the index.php document.
The way this is supposed to work is to type in “https://…/index.php?go=XXX” into the address bar of the browser, where XXX is the name of the file you want index.php to include into the middle of the document where “<? include($go.”.inc”); ?>” is. The files have the “.inc” extension just for asthetics.
I’m using my own custom theme that’s still being developed, but the theme itself shouldn’t affect the functionality of this simple PHP script. Unfortunately, it’s not working. I’ve tried inserting the first PHP line into the tops of both the main index.php in the root directory, AND the index.php in the theme directory. Neither one has been successful.
Here is the problem: Everytime I specify a different file in the url, like “index.php?go=info”, it will still load root, as if I’d typed “index.php?go=root” into the url.
Anyone got any ideas as to why this is? Possible solutions or alternatives?
- The topic ‘PHP Include Issue’ is closed to new replies.