DLed SecureAdmin and MysqlConn etc installed and most seems to be OK, but I get the following error when accessing a secured page.
Warning: ini_set() [function.ini-set]: A session is active. You cannot change the session module's ini settings at this time. in /usr/local/www/pages/secure/include/_sessions.php on line 26.
If I add user and password I get the following error
Warning: Cannot modify header information - headers already sent by (output started at /usr/local/www/pages/secure/include/_sessions.php:26) in /usr/local/www/pages/secure/_restrict.php on line 16.
Any ideas?
Howard Picken
Tasmania, Australia
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
<?php require '/usr/local/www/pages/secure/_restrict.php';
Include ('header.inc');
include ('/usr/local/www/configfiles/registers.inc');
if (!isset($id)) { // evaluates false
$id = 0;
}
blah ....
the header.inc file is just html stuff to add <head> <title> style sheet etc.
the registers.inc file is to do with access to the mysql database (user password etc).
Howard
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
<?php
require dirname(__FILE__).'/pages/secure/_restrict.php';
echo 'Logged in and ready for display';
?>
See if you still get an error from that. Another thing to consider is that having 'auto_prepend_file' set to something that outputs will create problems. Possibly having 'session.auto_start' set may also cause problems.
If you don't get problems from this, start adding your include files and code one piece at a time to see exactly where the error is coming from.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi guys
DLed SecureAdmin and MysqlConn etc installed and most seems to be OK, but I get the following error when accessing a secured page.
Warning: ini_set() [function.ini-set]: A session is active. You cannot change the session module's ini settings at this time. in /usr/local/www/pages/secure/include/_sessions.php on line 26.
If I add user and password I get the following error
Warning: Cannot modify header information - headers already sent by (output started at /usr/local/www/pages/secure/include/_sessions.php:26) in /usr/local/www/pages/secure/_restrict.php on line 16.
Any ideas?
Howard Picken
Tasmania, Australia
Do you explicitly use session_start before calling _restrict.php?
Do you have output (even a space before the first PHP tag) in your script before calling _restrict.php?
this is the top few lines of one of the pages.
<?php require '/usr/local/www/pages/secure/_restrict.php';
Include ('header.inc');
include ('/usr/local/www/configfiles/registers.inc');
if (!isset($id)) { // evaluates false
$id = 0;
}
blah ....
the header.inc file is just html stuff to add <head> <title> style sheet etc.
the registers.inc file is to do with access to the mysql database (user password etc).
Howard
I'd suggest trying a simple file like:
<?php
require dirname(__FILE__).'/pages/secure/_restrict.php';
echo 'Logged in and ready for display';
?>
See if you still get an error from that. Another thing to consider is that having 'auto_prepend_file' set to something that outputs will create problems. Possibly having 'session.auto_start' set may also cause problems.
If you don't get problems from this, start adding your include files and code one piece at a time to see exactly where the error is coming from.
Fixed! I turned off session_autostart in php.ini.
Thanks for all of your help.