Nasty Values :-)

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

    Nasty Values :-)

    Hi!
    I have installed PHP 4.3.7 on Apache 2.0 on RH9.
    Everything seems to go well( When I run <?php phpinfo() ;?> it works)
    but I can't manage up with values.Even in the simplest programm, I
    can't write out TEXTBOX's value:
    <HTML>
    <FORM>
    Please type your name here:<BR>
    <INPUT TYPE=TEXT NAME=username>< BR><BR>
    <INPUT TYPE=SUBMIT VALUE="Submit data">
    </FORM>
    <BR><BR>
    You typed:
    <?php
    echo($username) ;
    ?>
    </HTML>

    Output is:
    You typed:

    what it wrong?
    Thanks.
  • Pedro Graca

    #2
    Re: Nasty Values :-)

    Michael wrote:
    [snip][color=blue]
    ><?php
    > echo($username) ;[/color]

    Try
    echo $_GET['username'];
    [color=blue]
    > ?>
    ></HTML>
    >
    > Output is:
    > You typed:
    >
    > what it wrong?[/color]

    register_global s is wrong.

    PHP is a popular general-purpose scripting language that powers everything from your blog to the most popular websites in the world.



    --
    USENET would be a better place if everybody read: | to email me: use |
    http://www.catb.org/~esr/faqs/smart-questions.html | my name in "To:" |
    http://www.netmeister.org/news/learn2quote2.html | header, textonly |
    http://www.expita.com/nomime.html | no attachments. |

    Comment

    • Brian

      #3
      Re: Nasty Values :-)

      Michael wrote:
      [color=blue]
      > I have installed PHP 4.3.7 on Apache 2.0 on RH9. Everything seems to
      > go well( When I run <?php phpinfo() ;?> it works) but I can't manage
      > up with values.Even in the simplest programm, I can't write out
      > TEXTBOX's value:
      > <HTML>
      > <FORM>
      > Please type your name here:<BR>
      > <INPUT TYPE=TEXT NAME=username>< BR><BR>
      > <INPUT TYPE=SUBMIT VALUE="Submit data">
      > </FORM>
      > <BR><BR>
      > You typed:
      > <?php
      > echo($username) ;
      > ?>
      > </HTML>[/color]

      This is all in one page?
      [color=blue]
      > Output is:
      > You typed:
      >
      > what it wrong?[/color]

      $username is not set until the user submits the data, either by pressing
      the submit button or by other means. You need to have an action with the
      form, e.g.,

      <FORM action="myPhpSc ript.php">
      ....
      </FORM>

      on a web page. Enter a name in that page, e.g., "Joe Schmoe", and press
      the submit button. Then, myPhpScript.php will print "You typed: Joe
      Schmoe" (assuming no errors in your code).

      --
      Brian (remove "invalid" to email me)

      Comment

      • Michael

        #4
        Re: Nasty Values :-)

        Thanks Guys!

        It seems to work now
        ;-)

        Comment

        Working...