Failed to include a custom php page

I made a simple zenfooter.php page and called it using this code:

`<?php include ($_zp_themeroot . "/zenfooter.php"); ?>`

but I get this error message, although the file exists and in the right location:

`Warning: include() [function.include]: Failed opening '/collecties/themes/jacktummers/zenfooter.php' for inclusion (include_path='.:/var/php5.3/lib/php') in /srv/jackdaw/www/www.jacktummers.nl/collecties/themes/jacktummers/album.php on line 68`

Comments

  • You are calling the footer from another page of your template? If that's the case, you need to declare the _relative_ address. I.e. `<?php include ('zenfooter.php'); ?>`.

    If you insist on declaring an absolute path, the exact way to do it depends on your server's configuration. In my case, it would be something like: `<?php include ('/srv/jackdaw/www/www.jacktummers.nl/collecties/themes/jacktummers/zenfooter.php'); ?>`
    (you could actually find the first part of the code from SERVERPATH, if my memory is correct.)
  • Thank you! I thought I had to use the zp_themeroot variable because this is also used to include the themes stylesheet.
Sign In or Register to comment.