I'm getting the following error in my server error log:

[Sat Mar 24 23:12:06 2007] [error] [client 127.0.0.1] PHP Notice: Undefined variable: username in C:\Server\Apache2.2\htdocs\Jumploader\uploadHandler.php on line 3

Line 3:

$_SESSION['usuario'] = $username;

I don't understand why this session is undefined. One page previous, in the same session, 'usuario' is used to:

if (file_exists("c:\\Server\\upload\\".$_SESSION['usuario'])) {
   include("index.php");
} else {
mkdir ("c:\\Server\\upload\\".$_SESSION['usuario']);
   include("index.php");
}

Can I not use the same session multiple times?

Thanks!
Ben

    If you read the error message you'll see it's not complaining about the session variable $_SESSION['usuario']. It's complaining that the variable $username is not defined.

      It's saying that $username is undefined, not $_SESSION['usuario'].

      EDIT: Double posts are fun!

        I still don't understand. They're the same thing, aren't they? Because...

        $_SESSION['usuario'] = $username;

        And why is it undefined if the previous page used the exact same code and worked? Do sessions only work once?

        If you need I'll try to put up my scripts. I may be asking the wrong question.

        Thanks for the help! Ben Russell

          On the previous page you're using $_SESSION['usario']. That has nothing to do with the error on the current page. The current page is telling you that $username is undefined.

          You're trying to replace the value of $_SESSION['usario'] with $username which has never been defined.

            5 days later
            Write a Reply...