session-test script error

session-test script error

by Paula de Waal -
Number of replies: 2

I keep trying to solve some issues with moodle installed on lycos.

I tryed to use the session-test.php script but it returned an error:

Parse error: parse error, expecting `','' or `';'' in session_test.php on line 20.

 

php info tlls me that lycos runs php 4.1.0. Is that a big problem?

For the moment the main problem is the login. Users log-in but page redirects to the wrong root (the page where lycos drives you when it does not find what you want).

 

How can i solve this little problem?

Average of ratings: -
In reply to Paula de Waal

Re: session-test script error

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
I see it's still happening. See also: http://members.lycos.co.uk/phpworld/moodle

The URL you SHOULD be redirected to (after logging in) is the value you set in $CFG->wwwroot ...

I have no idea why that shouldn't be working on Lycos. sad

What happens if you edit login/index.php and change:

redirect($CFG->wwwroot);

into

redirect("$CFG->wwwroot/index.php");

or even:

redirect("http://members.lycos.co.uk/learninggroup/moodle/index.php");
In reply to Martin Dougiamas

Re: session-test script error

by Paula de Waal -

that was my initial guess too thoughtful.gif, but  login/index.php doesnt use "redirect".

pages are redirected by means of  

header("Location: $CFG->wwwroot");

other pages that use "redirect" , like logout.php, do not return errors.

Another theory ( and i hope it is not true) is that something goes wrong in the log-in process, which has nothing to do with the redirection, and the server redirects me to a default page instead of returning the error message.

I have solved the problem with the session-test script, with the help of a frind of mine which knows unix servers better than me. Thats the new version, its not elegant but lycos likes it:

<?PHP
/// This is a tiny standalone diagnostic script to test that sessions
/// are working correctly on a given server.
///
/// Just run it from a browser.   The first time you run it will
/// set a new variable, and after that it will try to find it again.
/// The random number is just to prevent browser caching.

session_start();

if (!isset($_SESSION["test"])) {   // First time you call it.
    echo "<P>No session found - starting a session now.";
    $_SESSION["test"] = "welcome back!";

} else {                           // Subsequent times you call it
    echo "<P>Session found - ".$_SESSION["test"];
    echo "<P>Sessions are working correctly</P>";
}

//echo "<P><A HREF="session_test.php?random=".rand(1,10000).">Reload this page</A></P>"

echo "<P><A HREF=\"session_test.php?random="; echo(rand(1,10000)); echo "\">Reload this page</A></P>"

?>