Form "POST" not passing on

EnverexEnverex Worcester, UK Icrontian
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">
</form>[/PHP]

Passed on to -
[PHP]<?php
echo $GN;
?>[/PHP]

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....

NS

Comments

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

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

    NS
  • MeltdownMeltdown NW GA
    edited June 2003
    Try
    [php]<?php
    $GN = $_POST;
    echo $GN;
    ?>
    [/php]

    The basic info came from php.net 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 Icrontian
    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 - http://atomnet.co.uk/pagethatdoesntahja

    NS
  • EnverexEnverex Worcester, UK Icrontian
    edited July 2003
    w00t

    http://atomnet.co.uk/amiga/?p=engine&module=search

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

    Cheers all,
    NS
Sign In or Register to comment.