Returning response includes HTML form data
| From: | Edward Diener | Date: | Sat, 02 Aug 2008 13:37:30 +0000 |
| Subject: | Returning response includes HTML form data | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-277612@lists.php.net to get a copy of this message | ||
I have a PHP file which does an:
echo "someresponse"
to return some data. When I run it from a Windows client program, the response I am seeing is not only the "someresponse" above but also has the entire HTML form in the PHP file appended to it.
Naturally I do not want the form to be included in the response and do not understand how or why I am getting it back ? Does anybody know why this is happening ?
As an example of what is happening my form data in the PHP file looks like:
<form ENCTYPE="multipart/form-data" ACTION="" METHOD="POST">
<input NAME="name1" TYPE="file">
<input NAME="name2" TYPE="text">
<input NAME="name3" TYPE="text">
<input VALUE="submit" TYPE="submit"></form>
Somewhere in the PHP file I am doing:
echo "someresponse"
and the data being read back in the response is a string of:
"someresponse\n<form ENCTYPE="multipart/form-data" ACTION=""METHOD="POST">\n<input NAME="name1" TYPE="file">\n<input NAME="name2" TYPE="text">\n<input NAME="name3" TYPE="text">\n<input VALUE="submit" TYPE="submit"></form>"