Menu

local install not pass variables ??

Help
2005-08-05
2013-04-15
  • Nobody/Anonymous

    Please forgive if this question has already been addressed,  I don't know enough about what I'm doing to search for the right terms.

    anyhow, I'm sure this is a dumb question, but I have a log in page.  simple stuff.  you type the password in and it loads the page.  but it won't do this.  I just keep getting the log in screen.  The password entered doesn't "reload" to be checked by the if statement.  do you know what I mean?  I see the variable and it's value in the url string but php is not 'seeing it'. 

    the script is this...

    $pwd = "mypassword";

    if ($passwd!=$pwd)
    {
    echo $pwd;
        echo "<form action=$gb_admin method='post'>";
        echo "<input type='password' name='passwd'>";
        echo "<br><input type='submit' value='OK'></form>";
        exit;
    }

    I guess I've got something not configured correctly?

    can anyone help?

    thank you so much!

    Kurt

     
    • Nobody/Anonymous

      well, I've answered my own question, but with caveats.

      it seems that if you turn "register_globals" to = on (in the php.ini file) that my problem is solved.

      but the comments above this param say :

      ; You should do your best to write your scripts so that they do not require
      ; register_globals to be on;  Using form variables as globals can easily lead
      ; to possible security problems, if the code is not very well thought of.

      so how could I have written my script differently with regard to the comments above?

      thanks,
      Kurt

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.