trouble passing arguments

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

    trouble passing arguments

    I have a RedHat Linux 8.0 system. I have started the httpd (Apache
    2.0.40) process and can now fetch pages from the server. I have a
    test htlm page which has a form that will take a string and try to
    send it back. The variable being passed in the form is not being
    displayed by the php script. This must be so simple that I am just
    overlooking something.

    <html>
    <body>
    <form action="testech o.php" method="POST">
    Enter String: <input type="text" instring="instr ing" />
    <input type="submit">
    </form>
    </body>
    </html>

    ---------- testecho.php code -----------------

    <html>
    <body>
    string 1
    <br>
    <?php
    $v1="string 2";
    echo $v1;
    ?>
    <BR>
    <?php
    $v1="string 3";
    echo $v1; ?>
    <br>
    <?php
    echo $_POST["instring"];
    ?>

    </body>
    </html>


    ----------- load the page and enter a string into form then submit
    -----------
    --------- the output of the returned html code is as follows
    -----------

    string 1
    string 2
    string 3

    ---------- the string I enter on the form is missing ---------

    I do not understand why the variable from the form is not being
    passed.
  • Doc Dunning

    #2
    Re: trouble passing arguments

    Walt

    Maybe its just that your form should say "name=instr ing" rather than
    "instring=instr ing"?


    "Walt Last" <kingstonarts@h otmail.com> wrote in message
    news:41f9485e.0 309201444.9f074 f4@posting.goog le.com...[color=blue]
    > I have a RedHat Linux 8.0 system. I have started the httpd (Apache
    > 2.0.40) process and can now fetch pages from the server. I have a
    > test htlm page which has a form that will take a string and try to
    > send it back. The variable being passed in the form is not being
    > displayed by the php script. This must be so simple that I am just
    > overlooking something.
    >
    > <html>
    > <body>
    > <form action="testech o.php" method="POST">
    > Enter String: <input type="text" instring="instr ing" />
    > <input type="submit">
    > </form>
    > </body>
    > </html>
    >
    > ---------- testecho.php code -----------------
    >
    > <html>
    > <body>
    > string 1
    > <br>
    > <?php
    > $v1="string 2";
    > echo $v1;
    > ?>
    > <BR>
    > <?php
    > $v1="string 3";
    > echo $v1; ?>
    > <br>
    > <?php
    > echo $_POST["instring"];
    > ?>
    >
    > </body>
    > </html>
    >
    >
    > ----------- load the page and enter a string into form then submit
    > -----------
    > --------- the output of the returned html code is as follows
    > -----------
    >
    > string 1
    > string 2
    > string 3
    >
    > ---------- the string I enter on the form is missing ---------
    >
    > I do not understand why the variable from the form is not being
    > passed.[/color]


    Comment

    • Derek Sorensen

      #3
      Re: trouble passing arguments

      On 20 Sep 2003 15:44:52 -0700, kingstonarts@ho tmail.com (Walt Last)
      wrote:
      [color=blue]
      >I have a RedHat Linux 8.0 system. I have started the httpd (Apache
      >2.0.40) process and can now fetch pages from the server. I have a
      >test htlm page which has a form that will take a string and try to
      >send it back. The variable being passed in the form is not being
      >displayed by the php script. This must be so simple that I am just
      >overlooking something.
      >
      ><html>
      ><body>
      ><form action="testech o.php" method="POST">
      >Enter String: <input type="text" instring="instr ing" />[/color]

      Try:

      Enter String: <input type="text" name="instring" />

      Regards,

      --
      Derek Sorensen

      Comment

      Working...