problem to get data from a form (method=get)

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

    problem to get data from a form (method=get)

    i am using redhat8 with default php installed, the problem i am facing
    is that:

    #test.php
    <?php
    echo $test_value;
    ?>

    localhost/test.php?test_v alue=abc

    whatever values i try, php can't get my values passed by get or direct
    url passing. do you have any ideas about that problem? thanks :)
  • Ian.H

    #2
    Re: problem to get data from a form (method=get)

    On Mon, 13 Sep 2004 02:57:11 +1000, linux newbie
    <linux_newbie_i diot@yahoo.com> wrote:
    [color=blue]
    >i am using redhat8 with default php installed, the problem i am facing
    >is that:
    >
    >#test.php
    ><?php
    > echo $test_value;
    >?>
    >
    >localhost/test.php?test_v alue=abc
    >
    >whatever values i try, php can't get my values passed by get or direct
    >url passing. do you have any ideas about that problem? thanks :)[/color]


    PEBKAC. RTFM!



    Regards,

    Ian

    --
    Ian.H
    digiServ Network
    London, UK

    Comment

    • kingofkolt

      #3
      Re: problem to get data from a form (method=get)

      "linux newbie" <linux_newbie_i diot@yahoo.com> wrote in message
      news:41447dba$0 $18968$afc38c87 @news.optusnet. com.au...[color=blue]
      > i am using redhat8 with default php installed, the problem i am facing
      > is that:
      >
      > #test.php
      > <?php
      > echo $test_value;
      > ?>
      >
      > localhost/test.php?test_v alue=abc
      >
      > whatever values i try, php can't get my values passed by get or direct
      > url passing. do you have any ideas about that problem? thanks :)[/color]

      Use $_GET['test_value'] instead of $test_value. Read the section of the PHP
      manual on register_global s.


      Comment

      • John Dunlop

        #4
        Re: problem to get data from a form (method=get)

        Ian.H wrote:
        [color=blue]
        > PEBKAC. RTFM![/color]

        Hehe.

        --
        Jock

        Comment

        • Matthias Esken

          #5
          Re: problem to get data from a form (method=get)

          linux newbie wrote:
          [color=blue]
          > #test.php
          > <?php
          > echo $test_value;
          > ?>
          >
          > localhost/test.php?test_v alue=abc
          >
          > whatever values i try, php can't get my values passed by get or direct
          > url passing. do you have any ideas about that problem? thanks :)[/color]

          ARGH! This question comes up every second day. Why do you all ignore the
          manual?

          => http://www.php.net/manual/en/languag...predefined.php

          Your variable will be in $_GET['test_value'].

          To avoid warnings from PHP, your code should look like this

          <?php
          echo isset($_GET['test_value']) ? $_GET['test_value'] : '';
          ?>

          or that:

          <?php
          if (isset($_GET['test_value'])) {
          echo $_GET['test_value'];
          }
          ?>


          Matthias

          Comment

          • kingofkolt

            #6
            Re: problem to get data from a form (method=get)

            > ARGH! This question comes up every second day.

            Very true.

            Someone should post a list of answers to common questions and title the post
            "LOOK HERE BEFORE YOU ASK ANY QUESTIONS." Then again, if people can't check
            the manual, they probably won't look at that post either...

            - JP


            Comment

            • linux newbie

              #7
              Re: problem to get data from a form (method=get)

              kingofkolt wrote:
              [color=blue][color=green]
              >>ARGH! This question comes up every second day.[/color]
              >
              >
              > Very true.
              >
              > Someone should post a list of answers to common questions and title the post
              > "LOOK HERE BEFORE YOU ASK ANY QUESTIONS." Then again, if people can't check
              > the manual, they probably won't look at that post either...
              >
              > - JP
              >
              >[/color]

              thank you so much :)
              but why it works on some redhat linux? without using
              $_GET['variable_name']???

              Comment

              • linux newbie

                #8
                Re: problem to get data from a form (method=get)

                Matthias Esken wrote:
                [color=blue]
                > linux newbie wrote:
                >
                >[color=green]
                >>#test.php
                >><?php
                >> echo $test_value;
                >>?>
                >>
                >>localhost/test.php?test_v alue=abc
                >>
                >>whatever values i try, php can't get my values passed by get or direct
                >>url passing. do you have any ideas about that problem? thanks :)[/color]
                >
                >
                > ARGH! This question comes up every second day. Why do you all ignore the
                > manual?
                >
                > => http://www.php.net/manual/en/languag...predefined.php
                >
                > Your variable will be in $_GET['test_value'].
                >
                > To avoid warnings from PHP, your code should look like this
                >
                > <?php
                > echo isset($_GET['test_value']) ? $_GET['test_value'] : '';
                > ?>
                >
                > or that:
                >
                > <?php
                > if (isset($_GET['test_value'])) {
                > echo $_GET['test_value'];
                > }
                > ?>
                >
                >
                > Matthias[/color]


                thank you so much :)
                but why it works on some redhat linux? without using
                $_GET['variable_name']???

                Comment

                • Ian.H

                  #9
                  Re: problem to get data from a form (method=get)

                  On Mon, 13 Sep 2004 23:53:01 +1000, linux newbie
                  <linux_newbie_i diot@yahoo.com> wrote:
                  [color=blue]
                  >Matthias Esken wrote:
                  >[color=green]
                  >> linux newbie wrote:
                  >>
                  >>[color=darkred]
                  >>>#test.php
                  >>><?php
                  >>> echo $test_value;
                  >>>?>
                  >>>
                  >>>localhost/test.php?test_v alue=abc
                  >>>
                  >>>whatever values i try, php can't get my values passed by get or direct
                  >>>url passing. do you have any ideas about that problem? thanks :)[/color]
                  >>
                  >>
                  >> ARGH! This question comes up every second day. Why do you all ignore the
                  >> manual?
                  >>
                  >> => http://www.php.net/manual/en/languag...predefined.php
                  >>
                  >> Your variable will be in $_GET['test_value'].
                  >>
                  >> To avoid warnings from PHP, your code should look like this
                  >>
                  >> <?php
                  >> echo isset($_GET['test_value']) ? $_GET['test_value'] : '';
                  >> ?>
                  >>
                  >> or that:
                  >>
                  >> <?php
                  >> if (isset($_GET['test_value'])) {
                  >> echo $_GET['test_value'];
                  >> }
                  >> ?>
                  >>
                  >>
                  >> Matthias[/color]
                  >
                  >
                  >thank you so much :)
                  >but why it works on some redhat linux? without using
                  >$_GET['variable_name']???[/color]


                  LOOK ABOVE!! There's even a damn manual reference!

                  Quality of PHP users here is really going downhill =(

                  Here.. plain and simple...


                  R E A D
                  T H E
                  F U C K I N'
                  M A N U A L


                  As you seem too stupid to understand an acronym.



                  Ian

                  --
                  Ian.H
                  digiServ Network
                  London, UK

                  Comment

                  • Ian.H

                    #10
                    Re: problem to get data from a form (method=get)

                    On Mon, 13 Sep 2004 23:52:00 +1000, linux newbie
                    <linux_newbie_i diot@yahoo.com> wrote:
                    [color=blue]
                    >kingofkolt wrote:
                    >[color=green][color=darkred]
                    >>>ARGH! This question comes up every second day.[/color]
                    >>
                    >>
                    >> Very true.
                    >>
                    >> Someone should post a list of answers to common questions and title the post
                    >> "LOOK HERE BEFORE YOU ASK ANY QUESTIONS." Then again, if people can't check
                    >> the manual, they probably won't look at that post either...
                    >>
                    >> - JP
                    >>
                    >>[/color]
                    >
                    >thank you so much :)
                    >but why it works on some redhat linux? without using
                    >$_GET['variable_name']???[/color]


                    There rests the case for the defense m'lord.



                    Ian

                    --
                    Ian.H
                    digiServ Network
                    London, UK

                    Comment

                    • Matthias Esken

                      #11
                      Re: problem to get data from a form (method=get)

                      linux newbie wrote:
                      [color=blue]
                      > Matthias Esken wrote:
                      >[color=green]
                      >> ARGH! This question comes up every second day. Why do you all ignore the
                      >> manual?
                      >>
                      >> => http://www.php.net/manual/en/languag...predefined.php[/color]
                      >
                      > thank you so much :)
                      > but why it works on some redhat linux? without using
                      > $_GET['variable_name']???[/color]

                      I'm still patient.

                      Read http://www.php.net/manual/en/languag...predefined.php.
                      Read the box with the fat header "Warning".

                      If you ask this question again, please add your credit card number.
                      You'll get charged by the "PHP Manual Read Out Service".

                      Matthias

                      Comment

                      • kingofkolt

                        #12
                        Re: problem to get data from a form (method=get)

                        "Ian.H" <ian@WINDOZEdig iserv.net> wrote in message
                        news:cq9bk01lpf su06bl1garvhdgo i5tb3ue43@4ax.c om...[color=blue]
                        > R E A D
                        > T H E
                        > F U C K I N'
                        > M A N U A L
                        >
                        >
                        > As you seem too stupid to understand an acronym.
                        >
                        >
                        >
                        > Ian
                        >
                        > --
                        > Ian.H
                        > digiServ Network
                        > London, UK
                        > http://digiserv.net/[/color]

                        ouch


                        Comment

                        Working...