Re: form and php
| From: | Gerard Samuel | Date: | Fri, 04 Oct 2002 17:38:26 +0000 |
| Subject: | Re: form and php | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-118896@lists.php.net to get a copy of this message | ||
I believe ->
<html>
<title>Test</title>
<body>
<p><b>Test</b></p>
<?php
$tmp = 20;
print("the value of tmp variable is $tmp");
print("the first variable is " . $_POST['varone']);
print("the second variable is " . $_POST['vartwo']);
?>
</body>
</html>
Tao Hou wrote:
Hi, I jsut install apache1.3.26 and php 4.2.3 on my win2000 machine for my course project. when I run: <? phpinfo(); ?> everything works fine, it will show me the information. but when I try the followings, it give me an error: ****************test.html******************** <html> <title>This page is for Power Calculation</title> <body> <form action="testphp1.php" method="GET"> Variable 1: <input type="text" name="varone"> Variable 2: <input type="text" name="vartwo"> <br> <input type="submit" name="submit" value="Submit Variables"> <input type="reset"> </form> </body> </html> ****************testphp1.php**************** <html> <title>Test</title> <body> <p><b>Test</b></p> <?php $tmp = 20; print("the value of tmp variable is $tmp"); print("the first variable is $varone"); print("the second variable is $vartwo"); ?> </body> </html> ************error message ******************** Test the value of tmp variable is 20 Notice: Undefined variable: varone in c:\apache\htdocs\testphp1.php on line 8 the first variable is Notice: Undefined variable: vartwo in c:\apache\htdocs\testphp1.php on line 9 the second variable is *************************************************************** please help me, thank you-- Gerard Samuel http://www.trini0.org:81/ http://dev.trini0.org:81/