Tuesday, November 04, 2008

PHP doesn't support dot characters in form names

I've written a PHP proxy script that communicates with an underlying application. I encountered a problem where the script is unable to proxy data that contains dot characters in the form name.

To illustrate:
<form action="test.php" method="post">
<input name="this.is.a/variable" type="text" />
<input type="submit" />
array(1) {
string(0) ""
Notice the array key in the var_dump(); dots are converted into underscore.


I accessed the raw input stream directly instead of using $_POST:
$data = file_get_contents("php://input");
$response = proxy_blah_blah($data);

No comments: