undefined variable

  • 14 years ago
    hi! i've already defined the variable but i got an error message undefined variable..
    any comments?..pls....




  • 14 years ago

    well without any code, no-one can make any comments that are of any value.

    please post the code which you are having problems with, and I can have a look.

    Otherwise it's like turning up to the mechanic to have your car fixed, and leaving the car at home Stick out tongue [:P]

    Always post code1 Big Smile [:D]

  • 14 years ago
    Notice how this won't work:

    $x = "y";
    function k() {
            echo $x;
    }
    k();







  • 14 years ago
    hi! thanks for the comment....

    the problem was that the order of my codes where not sequencially put as it should have been.
    i have put it like this:

    <?
    session_start();
    //connection here
    ?>

    <?
        //variables here
    ?>

    //then my input tags here
    <form method..>
    <input name =fname type=text>
    </form>.

    but it's okay now...have it fixed into this:

    <?
     //variables here
    ?>
    <?
     session_start();
    //connection here
    ?>

    // then the tags below


































Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Measuring programming progress by lines of code is like measuring aircraft building progress by weight.” - Bill Gates