I have been using includes for my content for a while now with no problems.
Suddenly it has stopped working, and it may or may not be from some changes
I made in my code structure.

I use default.php for most or all of my pages within a given directory,
changing the content via page numbers in the query string.

So on default.php, I have the following code:

  $thispage = $_GET['page'];
  $content = 'content/'.$_GET['page'].'.inc';
  $thispage = "default";
  $content = 'content/default.inc';
<html>, <body>, <div> etc.
<?php include($content); ?>

I have a content subdirectory where I store all the pages with files such as
"default.inc, 101.inc, 102.inc, etc.

As I said, this has been working fine up until now, if I use the url
"user/default.php" or just "user/" I get this error:

*Warning*: include(content/.inc)
failed to open stream: No such file or directory in *
/home/a9066165/public_html/user/default.php* on line *89*


*Warning*: include()
Failed opening 'content/.inc' for inclusion
(include_path='.:/usr/lib/php:/usr/local/lib/php') in *
/home/a9066165/public_html/user/default.php* on line *89*

But if I use "user/default.php?page=default"  I get the correct content.

It's acting as if page is set, but set to NULL, and then trying to find an
include at path "content/.inc"  what's going on??

Reply via email to