Need help with PHP session

Thanks for giving me all the files John. I modified the code as per your advice, and I met with few bugs which I hope you left it for my practise and I was able to solve them I believe :wink:

The __main.php code can be found in

The _function_show_setup.php is in:

I didnt make changes to the java script files.

The nav_admin.php is in:
http://pastebin.com/bcZCxsms

The admin_c1.php is in:
http://pastebin.com/dSC74aCA

the admin_select.php is in:
http://pastebin.com/i4ZyytJA

the index-001.php is in:
http://pastebin.com/AL7bMbNu

I made a mistake while pasting the “login_authentication.php” before, and it is as in the link below:
http://pastebin.com/fT57rm3e

I saw the “ERROR_LOG.PHP” was generated and it has the following two lines:

[11-Feb-2013 20:41:01 UTC] PHP Warning: require(): Filename cannot be empty in C:\webserver\www\proj-2-1\index-001.php on line 159

[11-Feb-2013 20:41:01 UTC] PHP Fatal error: require(): Failed opening required ‘’ (include_path=‘.;C:\php\pear’) in C:\webserver\www\proj-2-1\index-001.php on line 159

Can you tell me if I have done correctly as you have instructed? Also can you tell me more about these errors?

Thanks

Whoops, I have amended index-001.php, now the error does not appear, have also included/required the correct file and a PRE block to show the source file.

http://www.johns-jokes.com/downloads/sp-a/learner101/ver-001/index-001.php

I am pleased you can now see the “ERROR_LOG.PHP”.

[11-Feb-2013 20:41:01 UTC] PHP Warning: require(): Filename cannot be empty in C:\webserver\www\proj-2-1\index-001.php on line 159

The errors:

  1. 11-Feb-2013 20:41:01 UTC] - shows the date of the server.

  2. PHP Warning: require(): - type of error and the severity (Warning)

  3. Filename cannot be empty - error details

  4. C:\…\index-001.php - source file

  5. line 159 - line number

Special Note: ERROR_LOG.PHP is generated, new errors and warnings are appended. No damage is done if the file is deleted.

Off Topic:

Locally I usually start logging a new error file for each and every day, with a “.PHP” extension so that I can easily view the file in my text-editor:



   $fError = getcwd() .'/log-' .date('Y-m-d') .'.php';
   ini_set('error_log', $fError );


Hi John, I tried with the code you put in the link above. It is giving another error as:

Fatal error: Cannot redeclare _show_setup() (previously declared in C:\webserver\www\proj-2-1\_function_show_setup.php:5) in C:\webserver\www\proj-2-1\_function_show_setup.php on line 34

I also see that in the index-001.php you have if loops like:

<?php if(0) { require ‘_java-002.js’;}?>
<?php if(0) { require _show_setup();} ?>
<?php if(1) { require ‘_function_show_setup.php’;} ?>

Why do you have to give “if(0)”, wont this make the loop not to run?

Also I couldnt see where the functions is redeclared. I have pasted the _function_show_setup.php in the link: http://pastebin.com/8rWtgs5d

Hi learner101,

The basic idea I had in mind was to get you started with debugging. The index-001.php page now renders and error logging is now working.

Your javascript files are not being called because of the if(0) where 0 is a shortcut to FALSE.

Your mission is now to include the javascript files by changing if(0) to if(1) where the 1 is equivalent to TRUE.

Include each file one at a time and notice if any errors are being saved to the ERROR_LOG.PHP file. If there are errors then fix them, then move on to the next javascript file and change the 0 to 1.

The following link shows index-001.php without any javascript and without a stylesheet:

http://johns-jokes.com/downloads/sp-a/learner101/ver-001/index-001.php