3

Possible Duplicate:
How to get useful error messages in PHP?

I have the following html list:

<ul id="ulGroups">
<?php
include('organizer_picturearchive_groups.php');
?>
</ul>

I am trying to include this file, which also includes another file:

<?php
include('lib/organizer_functions/picture_archive.php');
    echo select_all_picture_category_groups();
?>

Basically, what I am trying to do is to call a function that is in the picture_archive.php file. I do that in the organizer_picturearchive_groups.php file. I am including this file in the first file where the html list is. I am not pasting the whole code from there, because it is a lot, but it works.

However the include thing doesn't, because when I tried to make a test echo statement in the "organizer_picturearchive_groups.php" file it works and I can see the text I am printing.

Do you have ideas what may cause this problem ?

Community
  • 1
  • 1
Apostrofix
  • 2,140
  • 8
  • 44
  • 71

1 Answers1

1

Double check the path. If organizer_picturearchive_groups.php is in the same directory as the code, then try configuring the path as relative:

<?php
include('./organizer_picturearchive_groups.php');
?>
dotancohen
  • 30,064
  • 36
  • 138
  • 197
  • I did that as you said, but now even the echo statement doesn't work. Still no errors. So, I guess the problem is with the other file: "organizer_picturearchive_groups.php" – Apostrofix Oct 01 '12 at 09:19
  • Post both complete files to pastebin, I'll take a look. – dotancohen Oct 01 '12 at 10:02
  • Thank you for the help, but actually I just fixed it and it works. But I couldn't understand where the problem was. I think it is because of the include statement and because I have some other includes in another files and maybe it makes conflicts or something...I am still new to PHP and and don't even know the syntax and so on. But I had this task.. Thank you all for the help! – Apostrofix Oct 01 '12 at 10:12
  • @Apostrofix I'm working with a legacy Wordpress site and am running into this same issue. I guess it's been 5 years, but if you remember your solution... – intrepid_em Jul 26 '17 at 13:34
  • 1
    @kauffee000 I can't exactly remember but my html file was including other php files which were including even more files. So there was a mistake somewhere either in the paths or with an incorrect include statement in one of those files. Double check your paths and names. – Apostrofix Jul 26 '17 at 13:39
  • @Apostrofix oh it didn't even occur to me that the child template might need to use a path relative to the parent. I'll give that a go, thanks. – intrepid_em Jul 26 '17 at 13:50