You are here: Why is PHP substituting an underscore in my form? « PHP Programming Language « IT news, forums, messages
Why is PHP substituting an underscore in my form?

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация