I've just started using PHP this morning, learning from the TechiWarehouse tutorial (http://www.techiwarehouse.com/PHP/PHP_Tutorial.html). I'm running PHP 4 on Microsoft Personal Web Server on a Win98 platform.
I was going fine..until I found out that I can't get the data submitted through HTML forms.
The HTML code I am using for testing purposes is as follows:
Code: Select all
<html>
<body>
<form action="result.php" method="get">
<input type="text" name="colour">
<input type="submit" name="submit">
</form>
</body>
</html>Code: Select all
<html>
<body>
<?php
echo "The colour is ";
echo $colour
?>
</body>
</html>(without the colour name that I submitted).The colour is
I have tried it using both form methods (GET and POST), but still no difference. Is there something I am missing in the PHP coding? In ASP you can't reference a form value with a plain variable, you either need to use request.form() or request.querystring(), but I assuming you don't need to do that in PHP because of the examples given in the tutorial mentioned above.
Is anyone able to shed some light on this?
Thanks
- Tim