Problem witch read input string_____

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • kliczko

    Problem witch read input string_____

    I have php4 on system FreeBSD.I did think that php work very well
    (function phpinfo() work), if I didn't probe above script:

    <?
    if(!isset($name )&&!isset($pass word))
    {
    ?>
    <h1>Please Log In</h1>
    This page is secret.
    <form method = post action = "secret.php ">
    <table border = 1>
    <tr>
    <th> Username </th>
    <td> <input type = text name = name> </td>
    </tr>
    <tr>
    <th> Password </th>
    <td> <input type = password name = password> </td>
    </tr>
    <tr>
    <td colspan =2 align = center>
    <input type = submit value = "Log In">
    </td>
    </tr>
    </form>
    <?
    }
    else if($name=="user "&&$password==" pass")
    {
    echo "<h1>Here it is!</h1>";
    echo "I bet you are glad you can see this secret page.";
    }
    else
    {
    echo "<h1>Go Away!</h1>";
    echo "You are not authorized to view this resource.";
    }
    ?>

    Always is fine but php don't read my input string.$name and $password
    always = ""
    What the problem?

    Sorry for my litle english.
    Mioduszaewski Artur.






  • Sebastian Heß

    #2
    Re: Problem witch read input string_____

    kliczko wrote:
    [color=blue]
    > I have php4 on system FreeBSD.I did think that php work very well
    > (function phpinfo() work), if I didn't probe above script:[/color]
    Your register_global s is set to "OFF". That's the new default value.
    Add this lines to the begin of your script:

    $name = $_REQUEST["name"];
    $password = $_REQUEST["password"];

    I don't think it's a good idea to turn register_global s on, so use the
    $_REQUEST Superglobal instead.

    Hope that helps

    Sebastian

    Comment

    • Sebastian Heß

      #3
      Re: Problem witch read input string_____

      kliczko wrote:
      [color=blue][color=green]
      >> I don't think it's a good idea to turn register_global s on,[/color]
      >
      > I have a litle knowledge about php, so how turn on the
      > register_global s.Give me a detailed describe how this doing.(in what
      > file?)[/color]
      I forgot the word not in my last posting =)

      If you realy want, you may activate it in the php.ini

      Hope that helps

      Comment

      Working...