Problems with post/get - while Global-Registers are "on"!

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

    Problems with post/get - while Global-Registers are "on"!

    Got a simple form:

    <form action="auswert ung.php" method="get">
    Ihr Vorname:
    <input type="text" name="Vorname">
    <input type="submit">
    </form>

    but there will be no Information shown on the php-document:

    <body>
    <h2>Auswertun g des Formulars</h2>
    <p>
    <?php
    echo "Hallo <b>$Vorname</b>, herzlich willkommen!";
    ?>
    </p>
    </body>
    </html>

    it is the same after altering "get" to "post" ...
    ???
  • Nobody

    #2
    Re: Problems with post/get - while Global-Registers are &quot;on&quo t;!

    Eisbaer schrieb:[color=blue]
    > Got a simple form:
    >
    > <form action="auswert ung.php" method="get">
    > Ihr Vorname:
    > <input type="text" name="Vorname">
    > <input type="submit">
    > </form>
    >
    > but there will be no Information shown on the php-document:
    >
    > <body>
    > <h2>Auswertun g des Formulars</h2>
    > <p>
    > <?php
    > echo "Hallo <b>$Vorname</b>, herzlich willkommen!";
    > ?>
    > </p>
    > </body>
    > </html>
    >
    > it is the same after altering "get" to "post" ...
    > ???[/color]

    Nein, das Problem welches du hast besteht darin, dass du
    höchstwahrschei nlich register_global s nicht eingeschalten hast. Es ist
    jedoch aus Sicherheitsgrün den ohnehin besser wenn dies deaktiviert ist.

    Wenn ein Formular abgeschickt wird sind dessen Daten in den Arrays $_GET
    und $_POST verfügbar, je nachdem welche method deine form hat. Du kannst
    also den Vornamen mit $_GET['Vorname'] ausgeben lassen.

    Wenn register_global s aktiviert ist, werden für die Elemente der $_GET
    und $_POST und einiger weiteren Superglobalen Arrays automatisch
    Variablen im globalen Scope erzeugt.

    --
    -------------------------------------------------------
    Try this: SCA the Smart Class Archive for PHP

    -------------------------------------------------------

    Comment

    • Nuno Paquete

      #3
      Re: Problems with post/get - while Global-Registers are &quot;on&quo t;!

      Eisbaer wrote:
      [color=blue]
      > Got a simple form:
      >
      > <form action="auswert ung.php" method="get">
      > Ihr Vorname:
      > <input type="text" name="Vorname">
      > <input type="submit">
      > </form>
      >
      > but there will be no Information shown on the php-document:
      >
      > <body>
      > <h2>Auswertun g des Formulars</h2>
      > <p>
      > <?php
      > echo "Hallo <b>$Vorname</b>, herzlich willkommen!";
      > ?>
      > </p>
      > </body>
      > </html>
      >
      > it is the same after altering "get" to "post" ...
      > ???[/color]

      Instead of getting the value the way you did, use this code:
      echo "Hallo <b>$_GET["Vorname"]</b>, herzlich willkommen!";
      It certainly works.

      Regards,
      Nuno Paquete

      Comment

      • Eisbaer

        #4
        Re: Problems with post/get - while Global-Registers are &quot;on&quo t;!

        Nuno Paquete <nmp@ispgaya.pt > wrote in message news:<41292ac3$ 0$30343$a729d34 7@news.telepac. pt>...[color=blue]
        > Eisbaer wrote:
        >[color=green]
        > > Got a simple form:
        > >
        > > <form action="auswert ung.php" method="get">
        > > Ihr Vorname:
        > > <input type="text" name="Vorname">
        > > <input type="submit">
        > > </form>
        > >
        > > but there will be no Information shown on the php-document:
        > >
        > > <body>
        > > <h2>Auswertun g des Formulars</h2>
        > > <p>
        > > <?php
        > > echo "Hallo <b>$Vorname</b>, herzlich willkommen!";
        > > ?>
        > > </p>
        > > </body>
        > > </html>
        > >
        > > it is the same after altering "get" to "post" ...
        > > ???[/color]
        >
        > Instead of getting the value the way you did, use this code:
        > echo "Hallo <b>$_GET["Vorname"]</b>, herzlich willkommen!";
        > It certainly works.
        >
        > Regards,
        > Nuno Paquete[/color]



        Danke / Thanks, but it still doesn't work ...

        Comment

        • Eisbaer

          #5
          Re: Problems with post/get - while Global-Registers are &quot;on&quo t;!

          Nobody <nobody@proje ct-sca.org> wrote in message news:<41288de0$ 0$9116$91cee783 @newsreader01.h ighway.telekom. at>...[color=blue]
          > Eisbaer schrieb:[color=green]
          > > Got a simple form:
          > >
          > > <form action="auswert ung.php" method="get">
          > > Ihr Vorname:
          > > <input type="text" name="Vorname">
          > > <input type="submit">
          > > </form>
          > >
          > > but there will be no Information shown on the php-document:
          > >
          > > <body>
          > > <h2>Auswertun g des Formulars</h2>
          > > <p>
          > > <?php
          > > echo "Hallo <b>$Vorname</b>, herzlich willkommen!";
          > > ?>
          > > </p>
          > > </body>
          > > </html>
          > >
          > > it is the same after altering "get" to "post" ...
          > > ???[/color]
          >
          > Nein, das Problem welches du hast besteht darin, dass du
          > h?chstwahrschei nlich register_global s nicht eingeschalten hast. Es ist
          > jedoch aus Sicherheitsgr?n den ohnehin besser wenn dies deaktiviert ist.
          >
          > Wenn ein Formular abgeschickt wird sind dessen Daten in den Arrays $_GET
          > und $_POST verf?gbar, je nachdem welche method deine form hat. Du kannst
          > also den Vornamen mit $_GET['Vorname'] ausgeben lassen.
          >
          > Wenn register_global s aktiviert ist, werden f?r die Elemente der $_GET
          > und $_POST und einiger weiteren Superglobalen Arrays automatisch
          > Variablen im globalen Scope erzeugt.[/color]

          Vielen Dank, diese Syntax kannte ich nicht. Aber auch so funktioniert
          es nicht; obwohl die registers_globa ls ON sind!

          Gru?

          Comment

          • kingofkolt

            #6
            Re: Problems with post/get - while Global-Registers are &quot;on&quo t;!

            "Eisbaer" <bjoernfranz@ho tmail.com> wrote in message
            news:de18f45e.0 408240919.7ba2b 844@posting.goo gle.com...[color=blue]
            > Nuno Paquete <nmp@ispgaya.pt > wrote in message[/color]
            news:<41292ac3$ 0$30343$a729d34 7@news.telepac. pt>...[color=blue][color=green]
            > > Eisbaer wrote:
            > >[color=darkred]
            > > > Got a simple form:
            > > >
            > > > <form action="auswert ung.php" method="get">
            > > > Ihr Vorname:
            > > > <input type="text" name="Vorname">
            > > > <input type="submit">
            > > > </form>
            > > >
            > > > but there will be no Information shown on the php-document:
            > > >
            > > > <body>
            > > > <h2>Auswertun g des Formulars</h2>
            > > > <p>
            > > > <?php
            > > > echo "Hallo <b>$Vorname</b>, herzlich willkommen!";
            > > > ?>
            > > > </p>
            > > > </body>
            > > > </html>
            > > >
            > > > it is the same after altering "get" to "post" ...
            > > > ???[/color]
            > >
            > > Instead of getting the value the way you did, use this code:
            > > echo "Hallo <b>$_GET["Vorname"]</b>, herzlich willkommen!";
            > > It certainly works.
            > >
            > > Regards,
            > > Nuno Paquete[/color]
            >
            >
            >
            > Danke / Thanks, but it still doesn't work ...[/color]

            Change the echo statement so that the double quotes in $_GET["Vorname"]
            won't have to be escaped:

            echo "Hallo <b>" . $_GET["Vorname"] . "</b>, herzlich willkommen!";


            Comment

            • Eisbaer

              #7
              Re: Problems with post/get - while Global-Registers are &quot;on&quo t;!

              "kingofkolt " <jessepNOSPAM@c omcast.net> wrote in message news:<HmLWc.519 09$Fg5.45685@at tbi_s53>...[color=blue]
              > "Eisbaer" <bjoernfranz@ho tmail.com> wrote in message
              > news:de18f45e.0 408240919.7ba2b 844@posting.goo gle.com...[color=green]
              > > Nuno Paquete <nmp@ispgaya.pt > wrote in message[/color]
              > news:<41292ac3$ 0$30343$a729d34 7@news.telepac. pt>...[color=green][color=darkred]
              > > > Eisbaer wrote:
              > > >
              > > > > Got a simple form:
              > > > >
              > > > > <form action="auswert ung.php" method="get">
              > > > > Ihr Vorname:
              > > > > <input type="text" name="Vorname">
              > > > > <input type="submit">
              > > > > </form>
              > > > >
              > > > > but there will be no Information shown on the php-document:
              > > > >
              > > > > <body>
              > > > > <h2>Auswertun g des Formulars</h2>
              > > > > <p>
              > > > > <?php
              > > > > echo "Hallo <b>$Vorname</b>, herzlich willkommen!";
              > > > > ?>
              > > > > </p>
              > > > > </body>
              > > > > </html>
              > > > >
              > > > > it is the same after altering "get" to "post" ...
              > > > > ???
              > > >
              > > > Instead of getting the value the way you did, use this code:
              > > > echo "Hallo <b>$_GET["Vorname"]</b>, herzlich willkommen!";
              > > > It certainly works.
              > > >
              > > > Regards,
              > > > Nuno Paquete[/color]
              > >
              > >
              > >
              > > Danke / Thanks, but it still doesn't work ...[/color]
              >
              > Change the echo statement so that the double quotes in $_GET["Vorname"]
              > won't have to be escaped:
              >
              > echo "Hallo <b>" . $_GET["Vorname"] . "</b>, herzlich willkommen!";[/color]

              ok, here is the trick: not only the variables worked, but also the
              whole of php. but when entering the right adress in the
              browser-adress-bar (instead of double-clicking) everything works fine
              ....
              regards
              bjoern

              Comment

              • Eisbaer

                #8
                Re: Problems with post/get - while Global-Registers are &quot;on&quo t;!

                bjoernfranz@hot mail.com (Eisbaer) wrote in message news:<de18f45e. 0408240923.4eb4 4e1@posting.goo gle.com>...[color=blue]
                > Nobody <nobody@proje ct-sca.org> wrote in message news:<41288de0$ 0$9116$91cee783 @newsreader01.h ighway.telekom. at>...[color=green]
                > > Eisbaer schrieb:[color=darkred]
                > > > Got a simple form:
                > > >
                > > > <form action="auswert ung.php" method="get">
                > > > Ihr Vorname:
                > > > <input type="text" name="Vorname">
                > > > <input type="submit">
                > > > </form>
                > > >
                > > > but there will be no Information shown on the php-document:
                > > >
                > > > <body>
                > > > <h2>Auswertun g des Formulars</h2>
                > > > <p>
                > > > <?php
                > > > echo "Hallo <b>$Vorname</b>, herzlich willkommen!";
                > > > ?>
                > > > </p>
                > > > </body>
                > > > </html>
                > > >
                > > > it is the same after altering "get" to "post" ...
                > > > ???[/color]
                > >
                > > Nein, das Problem welches du hast besteht darin, dass du
                > > h?chstwahrschei nlich register_global s nicht eingeschalten hast. Es ist
                > > jedoch aus Sicherheitsgr?n den ohnehin besser wenn dies deaktiviert ist.
                > >
                > > Wenn ein Formular abgeschickt wird sind dessen Daten in den Arrays $_GET
                > > und $_POST verf?gbar, je nachdem welche method deine form hat. Du kannst
                > > also den Vornamen mit $_GET['Vorname'] ausgeben lassen.
                > >
                > > Wenn register_global s aktiviert ist, werden f?r die Elemente der $_GET
                > > und $_POST und einiger weiteren Superglobalen Arrays automatisch
                > > Variablen im globalen Scope erzeugt.[/color]
                >
                > Vielen Dank, diese Syntax kannte ich nicht. Aber auch so funktioniert
                > es nicht; obwohl die registers_globa ls ON sind!
                >
                > Gru?[/color]

                ok, here is the trick: not only the variables worked, but also the
                whole of php. but when entering the right adress in the
                browser-adress-bar (instead of double-clicking) everything works fine
                ....
                beste grüsse
                bjoern

                Comment

                • kingofkolt

                  #9
                  Re: Problems with post/get - while Global-Registers are &quot;on&quo t;!

                  "Eisbaer" <bjoernfranz@ho tmail.com> wrote in message
                  news:de18f45e.0 408250933.586fd 4ac@posting.goo gle.com...[color=blue]
                  > "kingofkolt " <jessepNOSPAM@c omcast.net> wrote in message[/color]
                  news:<HmLWc.519 09$Fg5.45685@at tbi_s53>...[color=blue][color=green]
                  > > "Eisbaer" <bjoernfranz@ho tmail.com> wrote in message
                  > > news:de18f45e.0 408240919.7ba2b 844@posting.goo gle.com...[color=darkred]
                  > > > Nuno Paquete <nmp@ispgaya.pt > wrote in message[/color]
                  > > news:<41292ac3$ 0$30343$a729d34 7@news.telepac. pt>...[color=darkred]
                  > > > > Eisbaer wrote:
                  > > > >
                  > > > > > Got a simple form:
                  > > > > >
                  > > > > > <form action="auswert ung.php" method="get">
                  > > > > > Ihr Vorname:
                  > > > > > <input type="text" name="Vorname">
                  > > > > > <input type="submit">
                  > > > > > </form>
                  > > > > >
                  > > > > > but there will be no Information shown on the php-document:
                  > > > > >
                  > > > > > <body>
                  > > > > > <h2>Auswertun g des Formulars</h2>
                  > > > > > <p>
                  > > > > > <?php
                  > > > > > echo "Hallo <b>$Vorname</b>, herzlich willkommen!";
                  > > > > > ?>
                  > > > > > </p>
                  > > > > > </body>
                  > > > > > </html>
                  > > > > >
                  > > > > > it is the same after altering "get" to "post" ...
                  > > > > > ???
                  > > > >
                  > > > > Instead of getting the value the way you did, use this code:
                  > > > > echo "Hallo <b>$_GET["Vorname"]</b>, herzlich willkommen!";
                  > > > > It certainly works.
                  > > > >
                  > > > > Regards,
                  > > > > Nuno Paquete
                  > > >
                  > > >
                  > > >
                  > > > Danke / Thanks, but it still doesn't work ...[/color]
                  > >
                  > > Change the echo statement so that the double quotes in $_GET["Vorname"]
                  > > won't have to be escaped:
                  > >
                  > > echo "Hallo <b>" . $_GET["Vorname"] . "</b>, herzlich willkommen!";[/color]
                  >
                  > ok, here is the trick: not only the variables worked, but also the
                  > whole of php. but when entering the right adress in the
                  > browser-adress-bar (instead of double-clicking) everything works fine
                  > ...
                  > regards
                  > bjoern[/color]

                  Another option is to stick the variable in a set of curly braces:

                  echo "Hallo <b>{$_GET["Vorname"]}</b>, herzlich willkommen!";


                  Comment

                  Working...