I am a newbie in PHP. I am using PWS as my server. I enter data in
addToForm.html file and then click the submit button, but the
processForm.php file always indicate that the variables are empty. It
appears as if the data is not passed to processForm.php file. Please
help.
addToForm.html
<html>
<head>
<title>add to Form</title>
</head>
<body>
<form action="process Form.php" method="get">
Enter your name:
<input type="text" name="userName" ><br>
Where do you live?
<input type="text" name="region">< br>
<input type="submit" name="submit">
</form>
</body>
</html>
-----------------------
processForm.php
<html>
<head>
<title>Proces s Form Data</title>
</head>
<body>
<?php
print "Thank you $userName<br>";
print "You live in: $region";
?>
</body>
</html>
-------------------
And the output is as follows.
Notice: Undefined variable: userName in
C:\Inetpub\wwwr oot\visual\proc essForm.php on line 10
Thank you
Notice: Undefined variable: region in
C:\Inetpub\wwwr oot\visual\proc essForm.php on line 11
You live in:
addToForm.html file and then click the submit button, but the
processForm.php file always indicate that the variables are empty. It
appears as if the data is not passed to processForm.php file. Please
help.
addToForm.html
<html>
<head>
<title>add to Form</title>
</head>
<body>
<form action="process Form.php" method="get">
Enter your name:
<input type="text" name="userName" ><br>
Where do you live?
<input type="text" name="region">< br>
<input type="submit" name="submit">
</form>
</body>
</html>
-----------------------
processForm.php
<html>
<head>
<title>Proces s Form Data</title>
</head>
<body>
<?php
print "Thank you $userName<br>";
print "You live in: $region";
?>
</body>
</html>
-------------------
And the output is as follows.
Notice: Undefined variable: userName in
C:\Inetpub\wwwr oot\visual\proc essForm.php on line 10
Thank you
Notice: Undefined variable: region in
C:\Inetpub\wwwr oot\visual\proc essForm.php on line 11
You live in:
Comment