i just moved to a new host and my php layout includes don't show! i changed my paths to the new ones and i dont get any errors or anything, it just doesn't show! does anybody know a robust and secure php layout includes code? One that calls a cetain page, and if that page doesn't exist it calls another page. Like you know when you go to a website they have the latest news on the main page and then the content area changes, but the layout stays the same, as they go to different pages. And the page url changes lfrom like http://www.site.com to http://www.site.com/index.php?m=pagename as you go from the main page to another part of the site. Please help!! I will positive rep you! Thanks!!!
i don't understand what you mean by defined? By the way, the include function works on the site and I get the news to show up, however the "else" function does not seem to work. Is their an alternative to the "else" or is something on my site turned off that si supposed to be on?
Sounds like you had register_globals set ON on your old host (and it's now set OFF). register_globals set ON is a security issue, but you can normally override it with a line in your .htaccess file, I believe.
Do you know how to access register_globals? Is that in the php.ini file? I created a new code that works though, so thanks for the help
Firstly, you can set it in PHP.INI to affect the entire installation. If you have it disabled on the site but want it enabled for a single directory (and all of its subdirectories) you can add the line: php_flag register_globals off to a .htaccess file in that directory. It's not recommended use and according to http://ca3.php.net/manual/en/ini.core.php#ini.register-globals it doesn't even exist in PHP6.
You can always use the function file_exists in order to check if a file is there. ex: But what you can do in your example is, http://www.site.com/index.php?m=pagename is specifying you need to include the content of "pagename". So you can do: