Simple Authorization Script

Troubleshooting

Frequently asked questions and troubleshooting for Simple Authorization Script. Here is a list of common problems and their solutions.

There is a known issue of SAS and the PHP error reporting level of web servers. There is a config file on web servers that sets the error reporting levels for PHP scripts, typically, this reporting level is set to:

error_reporting(E_ALL ^ E_NOTICE);

Meaning that PHP will report all errors and warnings, but NOT PHP notices. On some occasions, web servers are set to to report all errors, warnings AND notices, this typically looks like this in the PHP config file:

error_reporting(E_ALL);

OR

error_reporting(E_STRICT);

SAS may show some PHP notices when error reporting is set to E_ALL. Typically, you'll see the following notice at the top of your web page.

PHP Notice: Undefined index: ...

This is one solution to resolve this problem:

  1. Open up sas.php
  2. Add the following code as the second line of the file (under <?php) error_reporting(E_ALL ^ E_NOTICE);
  3. Save and upload sas.php

Another known issue is when the correct login is entered and the script lets you view the password protected page, but you get a warning message at the top of the page that looks a little like this:

Warning: Cannot modify header information - headers already sent by ...

This possible warning was introduced when I added the optional logout button and logout text. I suspect that the warning occurs when sas.php has been modified, in particular, if the logout code has been changed. I have tried to reproduce this problem, but have so far been unsuccessful.

So what's the solution? Firstly, as with any problems you encounter while installing any scripts, I would suggest that you try installing and using SAS unmodified.

If you still get the "Cannot modify header information" warning with the vanilla version of SAS and if you would like to work with me in solving this problem, then please contact me.

If you DO NOT intend to use the logout feature, then I suggest removing the logout code completely. The logout code is everything between the so named comment, ie

/* Logout Stuff - Sept 5, 2005 */
...
...
...
/* End Logout Stuff */


Still have problems?

Try testing a unmodified version of demo.php and sas.php.

  1. Upload an unmodified version of demo.php and sas.php
  2. Open up demo.php in your web browser, e.g. http:www.yourwebsite.com/demo.php
  3. Test the script by entering in an incorrect password, then enter in the correct password.

Does it work? If not, please feel free to contact us or ask a question. Remember to leave details and specifics of your problem, simply stating "It doesn't work" doesn't help me help you solve the problem!