typing lynx in input box breaks script?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • squash@peoriadesignweb.com

    typing lynx in input box breaks script?

    I have a very simple form where if the user types in lynx anything,
    it gives a 403 forbidden error? Here is the url:



    I know lynx is shell web browser, so could the php be interpreting
    that as some kind of shell command instead of a variable?

  • Ken Robinson

    #2
    Re: typing lynx in input box breaks script?


    squash@peoriade signweb.com wrote:[color=blue]
    > I have a very simple form where if the user types in lynx anything,
    > it gives a 403 forbidden error? Here is the url:
    >
    > http://www.peoriadesignweb.com/dev/test.php[/color]

    Please post your script. Without seeing what you are doing, it is
    impossible to attempt to debug your problem.

    Ken

    Comment

    • squash@peoriadesignweb.com

      #3
      Re: typing lynx in input box breaks script?

      <?php

      if ( isset ( $_REQUEST['message'] )) echo '<h3> Hello World </h3>';

      echo "<form action=test.php method=post>
      <input type=text name=message value='lynx abc'>
      <input type=submit value='Click here to see Hello World'>
      </form>

      <p> Type anything in place of 'lynx abc' and the script will work!";

      ?>

      Comment

      • Andre Frashek

        #4
        Re: typing lynx in input box breaks script?

        squash@peoriade signweb.com wrote:[color=blue]
        > <?php
        >
        > if ( isset ( $_REQUEST['message'] )) echo '<h3> Hello World </h3>';
        >
        > echo "<form action=test.php method=post>
        > <input type=text name=message value='lynx abc'>
        > <input type=submit value='Click here to see Hello World'>
        > </form>
        >
        > <p> Type anything in place of 'lynx abc' and the script will work!";
        >
        > ?>
        >[/color]

        Hi, the script won´t work, because you forgot the curly braces in your
        if instruction and IMHO some quotes. This works good for me:

        <?php
        if (isset($_REQUES T['message'])) {
        echo '<h3>Hello World</h3>';
        }

        echo ' <form action="test.ph p" method="post">
        <input type="text" name="message" value="lynx abc">
        <input type="submit" value="Click here to see Hello World">
        </form>
        <p>Type anything in place of "lynx abc" and the script will work!</p>
        ';
        ?>

        Comment

        • Ken Robinson

          #5
          Re: typing lynx in input box breaks script?


          Andre Frashek wrote:[color=blue]
          > Hi, the script won´t work, because you forgot the curly braces in your
          > if instruction and IMHO some quotes. This works good for me:[/color]

          You don't need the curly braces if the statement block consists of one
          statement.

          The original script works fine on my local box.

          But, yes, attribute values should be quoted at all times.

          Ken

          Comment

          Working...