Davigetto Posted September 5, 2008 Share Posted September 5, 2008 Hello, I'm developing modules for an IMS (Moodle) and, taking a look on the code, I've found something like this: <?php //$Id: restore_check.html,v 1.48.2.6 2008/05/02 04:07:30 dongsheng Exp $ //This page receive all the restore_form data. Then, if existing course //has been selected, shows a list of courses to select one. //It cheks that the parammeter from restore_form are coherent. //It puts all the restore info in the session. //Finally, it calls restore_execute to do the hard work //Get objects from session if ($SESSION) { $info = $SESSION->info; $course_header = $SESSION->course_header; if (isset($SESSION->restore)) { $restore = $SESSION->restore; } } ... $SESSION variable is being read, however, in that file SESSION variable is not assigned at any place, and no declaration before. What is the reason for that? Greetings PD: Maybe I've done a bad explanation of my problem. If anyone needs more info, I shall give him it. Quote Link to comment Share on other sites More sharing options...
stuffradio Posted September 5, 2008 Share Posted September 5, 2008 They could be using global variables? Quote Link to comment Share on other sites More sharing options...
Mchl Posted September 5, 2008 Share Posted September 5, 2008 Maybe this file is included into some other script? You're sure its $SESSION and not $_SESSION (which is default global variable)? Quote Link to comment Share on other sites More sharing options...
Davigetto Posted September 5, 2008 Author Share Posted September 5, 2008 Maybe this file is included into some other script? You're sure its $SESSION and not $_SESSION (which is default global variable)? Do you refer this? //Call the form, depending the step we are if (!$launch) { include_once("restore_precheck.html"); } else if ($launch == "form") { if (!empty($SESSION->restore->importing)) { ... Over the include_once, $SESSION variable has a value, but is this value passed indirectly to restore_precheck.html? Does The code of restore_precheck.html represent that it is being located literally after "if (!$launch)" instruction? PD: I'm a Java developer, not PHP, so seeing this kind of code makes me mad and strange... Quote Link to comment Share on other sites More sharing options...
Mchl Posted September 5, 2008 Share Posted September 5, 2008 Yeah. It means that code from "restore_precheck.html" file is put in its entirety in this place. See the manual for including Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.