By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,642 Members | 1,687 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,642 IT Pros & Developers. It's quick & easy.

Data not passed to PHP file after submit

P: n/a
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="processForm.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>Process 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\wwwroot\visual\processForm.php on line 10
Thank you

Notice: Undefined variable: region in
C:\Inetpub\wwwroot\visual\processForm.php on line 11
You live in:
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Carved in mystic runes upon the very living rock, the last words of John of
comp.lang.php make plain:
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.


I don't know about PWS, but for IIS, file upload is not enabled by default.
You might want to inquire about that in an MS group.

--
Alan Little
Phorm PHP Form Processor
http://www.phorm.com/
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.