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="documen t.forms[0].submit();">
<form name="f" action="test_re sponse.php" method="post">
<input type="hidden" name="Hi There" value="2">
</form>
</body>
</html>
and then test_response.p hp
<?php
foreach (array_keys($_R EQUEST) 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.2 38415504.116025 2422.1161727205 .1161788841.6
key: __utmz
val:171843875.1 160252422.1.1.u tmccn=(direct)| utmcsr=(direct) |utmcmd=(none)
key: PHPSESSID val:f8cc02f8aa6 3d9cd7a50e6a1d3 40b1b8
How do I preserve the space in the element name?
Thanks, - Dave
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="documen t.forms[0].submit();">
<form name="f" action="test_re sponse.php" method="post">
<input type="hidden" name="Hi There" value="2">
</form>
</body>
</html>
and then test_response.p hp
<?php
foreach (array_keys($_R EQUEST) 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.2 38415504.116025 2422.1161727205 .1161788841.6
key: __utmz
val:171843875.1 160252422.1.1.u tmccn=(direct)| utmcsr=(direct) |utmcmd=(none)
key: PHPSESSID val:f8cc02f8aa6 3d9cd7a50e6a1d3 40b1b8
How do I preserve the space in the element name?
Thanks, - Dave
Comment