To talk on Icrontic, just register!

It only takes 30 seconds.

Have an account? Sign in:

Forgot?
Enverex
~-+-~
Enverex
5,852 Posts

Form "POST" not passing on

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 Code:
<form method="post" action="searcher.php">
<
input type="text" name="GN">
<
input type="reset" value="Clear">
<
input type="submit" value="Find Game">
</
form
Passed on to -
PHP Code:
<?php
echo $GN;
?>
Just does -
Notice: Undefined variable: GN in C:\http\ac\amiga\searcher.php on line 2
Any ideas? As there is no reason that this shouldnt be working afaikt, as I have looked up about 500 examples now....

NS
__________________ RetroTracks - Classic Computer and Game Music
versello
w00t! keke ^_^
versello
1,983 Posts
Your text input has no value. It should read

< input type="text" name="GN" value="" >
Enverex
~-+-~
Enverex
5,852 Posts
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
Meltdown
New to the neighborhood
Meltdown
2 Posts
Try
PHP Code:
<?php 
$GN 
$_POST['GN']; 
echo 
$GN;
?>
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.
ElectusUnum
Icrontic Convert
ElectusUnum
11 Posts
I would just use $_POST['GN'] 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!)
__________________ I'm with stupid
|
|
V
Enverex
~-+-~
Enverex
5,852 Posts
Ah, as I was looking at something that said it was HTTP_GET_FORMDATA_SOME_OTHER_STUFF_THAT_WAS_WRONG['doesntmatteritsallwronganyway']

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

Oh, read the bottom server message - http://atomnet.co.uk/pagethatdoesntahja

NS
Enverex
~-+-~
Enverex
5,852 Posts
w00t

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

Enter 'world' or 'cannon' or something

Cheers all,
NS
Go Back   Icrontic Forums > Tech: Software > General Software
Jump to
This Thread Search this Thread
Search this Thread:

Advanced Search


Current time: 10:58pm (GMT)
Powered by vBulletin®
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Get Vanilla instead. Trust me.