Form "POST" not passing on

EnverexEnverex Worcester, UK
edited July 2003 in Science & Tech
Trying to get a form to pass some data on, but its just not working.

Apparently the name of the entry box becomes the variable the value is stored in when the form gets passed on, but it doesnt seem to be working......

Form -
[PHP]<form method="post" action="searcher.php">
<input type="text" name="GN">
<input type="reset" value="Clear">
<input type="submit" value="Find Game">

Passed on to -
echo $GN;

Just does -
<b>Notice</b>: Undefined variable: GN in <b>C:\http\ac\amiga\searcher.php</b> on line <b>2</b>

Any ideas? As there is no reason that this shouldnt be working afaikt, as I have looked up about 500 examples now....



  • edited June 2003
    Your text input has no value. It should read

    < input type="text" name="GN" value="" >
  • EnverexEnverex Worcester, UK
    edited June 2003
    Value just states the initial value, i.e. If I put
    in the text box then when the page loads, it will just say "Cheese".

  • MeltdownMeltdown NW GA
    edited June 2003
    $GN = $_POST;
    echo $GN;

    The basic info came from tutorial.
    I just started messing with php a few days ago so there may be a better solution.
  • edited June 2003
    I would just use $_POST instead of copying it to a new variable. Saves memory, but I'm weird like that (a few bytes of text won't matter, but I must have every nanosecond of speed!)
  • EnverexEnverex Worcester, UK
    edited June 2003
    Ah, as I was looking at something that said it was HTTP_GET_FORMDATA_SOME_OTHER_STUFF_THAT_WAS_WRONG

    So cheers for clearing that up. Yeah, globals is staying off.

    Oh, read the bottom server message -

  • EnverexEnverex Worcester, UK
    edited July 2003

    Enter 'world' or 'cannon' or something :p

    Cheers all,
Sign In or Register to comment.