Posted by laredotornado@zipmail.com on 11/06/06 04:29
Hi,
I'm using PHP 4.4.4. I notice for form elements that contain spaces,
PHP substitutes an underscore for the element name when the form is
submitted. For example, if I have this page (test.php)
<html>
<body onload="document.forms[0].submit();">
<form name="f" action="test_response.php" method="post">
<input type="hidden" name="Hi There" value="2">
</form>
</body>
</html>
and then test_response.php
<?php
foreach (array_keys($_REQUEST) as $k) {
$val = $_REQUEST[$k];
print "key: $k val:$val<BR>\n";
} // foread
?>
the output is
key: Hi_There val:2
key: __utma val:171843875.238415504.1160252422.1161727205.1161788841.6
key: __utmz
val:171843875.1160252422.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none)
key: PHPSESSID val:f8cc02f8aa63d9cd7a50e6a1d340b1b8
How do I preserve the space in the element name?
Thanks, - Dave
[Back to original message]
|