A form is sent to another (or the same) php file using POST or GET.
The variables sent must be read by the receiving file: you don't read them in your code...
Two examples: the first uses two files, the second uses only one. Spaces are added for clarity (and YA line stripper!)
form.htm
-------------------------
...
------------------------
results.php
------------------------
...
echo ( $_POST [ ' name ' ] . "
");
?>
---------------------------
(your echo line is incorrect)
-------------------------------------------
Sample 2: the SAME file calls itself.
-------------------------------------------
form.php
-------------------------
function showform ( $_POST )
{
echo ( '
' );
}
function showresults ( $_POST )
{
while ( list ( $name , $value ) = each ( $_POST ) )
$$name=$value; // extract all variables from $_POST
echo ( $name . "
") ;
unset ( $_POST ); // clear the post!
}
?>
if ( isset ($_POST [ ' name' ] ) )
showresults ($_POST) ;
else
showform ( ) ;
?>
-------------------------
PS: use "< br space - slash - >" (YA bugs it... again... )
2007-11-15 19:11:08
·
answer #1
·
answered by just "JR" 7
·
0⤊
0⤋
You have to retrieve the value from the form first.
$name = $_POST['name'];
echo $name;
?>
2007-11-15 17:48:57
·
answer #2
·
answered by catbertnc 5
·
1⤊
0⤋
Change the name of the textbox to something else like name_text.
I think its sue to the fact that name is also a reserved keyword in PHP and HTML
2007-11-15 17:49:30
·
answer #3
·
answered by Anonymous
·
0⤊
1⤋