Password Protected Page Error

I am working on a gallery called Our Picture Share (www.ourpictureshare.com), if you visit the gallery and click on an album you'll be prompted for a password.

At the very top of this page I am getting an error: `header('Last-Modified: ' . ZP_LAST_MODIFIED); header('Content-Type: text/html; charset=' . LOCAL_CHARSET);`

Anyone know how to fix this issue, so you don't see the error message?

Thanks,
Josh

Comments

  • acrylian Administrator, Developer
    Does it happen with a standard theme? If not your theme is not setup correctly.
  • This is definately an issue with your theme. You have that header statement output as HTML text, it should be a PHP stantement and therefore enclosed in `` brackets.
  • The thing I don't understand is that if it's an issue with the theme, why do all of my other pages (including the admin login page) look and function just fine - without error? I'll test out the standard theme today and see what's going on :)

    Thanks,
    Josh
  • I discovered the problem and it's not with my theme...

    If you go to the default ZenPhoto installation and locate the zp-core folder you'll see a file called password.php, this is the default password template page.

    At the top you will see three lines:

    `<?php if (!defined('WEBPATH')) die(); ?>`
    `header('Last-Modified: ' . ZP_LAST_MODIFIED);`
    `header('Content-Type: text/html; charset=' . LOCAL_CHARSET);`

    Which should read:

    `<?php if (!defined('WEBPATH')) die();`
    `header('Last-Modified: ' . ZP_LAST_MODIFIED);`
    `header('Content-Type: text/html; charset=' . LOCAL_CHARSET); ?>`

    The reason why it was displaying the header information was because the header information wasn't included in the `<?php ?>` tags, so it was being displayed as text...once I made the change everything worked fine :)

    Thanks,
    Josh
  • Thanks for the information. We will fix that. But, still is your theme, though. That file is only used if the theme does not supply one. All our themes do supply the file.
  • sbillard,

    I understand that one :) I have created a password.php file of my own and everything looks much better now, still trying to get things the way I want them, but am glad that this particular issue has been fixed, as it not only affects me.

    Thanks,
    Josh
Sign In or Register to comment.