Beginners problem

From: Rolf Wester (wester_at_ilt.fraunhofer.de)
Date: 10/31/03


Date: Fri, 31 Oct 2003 17:53:45 +0100

Hi,

I'm just beginning PHP programming. I have installed Apache 2.0.48 and
PHP 4.3.3. The installation went well. Then I was trying a little example.

HTML page:

<html>
   <head>
     <title>test</title>
   </head>

   <body>

        <form action="test.php" method=POST>
          First Name: <input type=text name=firstname size=30
                         MAXLENGTH=150>
                    <input type=submit value="Send">
        </form>

   </body>
</html>

and the PHP script "test.php":

<?php
echo "First Name = ";
echo $firstname;
echo ".";
?>

When I insert "Rolf" into the textfield and hit the "Send" button I get
the response:

First Name = .

Nothing else. I thought that the variable $firstname is set to the
string I inserted into the text field. Did I do anything wrong or could
there be a problem with apache or php? I would be very appreciative for
help on this problem.

Regards

Rolf Wester

P.S.: When using method GET the form calls:
http://localhost:8080/test.php?firstname=Rolf
The Response is the same as before.


Quantcast