[GLLUG] HTML/PHP form submission problem - periods become underscores

C. Ulrich dincht at securenym.net
Mon Nov 17 16:14:53 EST 2003

On Mon, 2003-11-17 at 11:22, Edward Glowacki wrote:
> I'm having a weird problem with HTML form submission.  My form contains
> a series of entries like the following:
> <input type="checkbox" name="system:www.msu.edu[]" value="wid" />
> However, when I try to extract the data from $_REQUEST, it has no key
> for "system:www.msu.edu", but it DOES have "system:www_msu_edu".  I
> would try to search-and-replace underscores with periods, but
> underscores are also valid in this context.  Is there something in the
> form data encoding, or HTTP/HTML specs that specify "." as an invalid
> character that would cause this problem?  I think I'm using the proper
> encoding:
> <form method="post" enctype="multipart/form-data" action="">
> Any suggestions would be appreciated.  Thanks!
> -ED

I've never seen this myself, and I don't know PHP, but perhaps the
period has special significance in PHP variables?

Assuming that this might be expected behavior, you could try
URI-encoding the periods with %2E. The browser will still display and
handle it as a period, but you'll need to decode it when it gets sent
back. I would be highly surprised if PHP didn't have a function or
library or something to make this easy.

Charles Ulrich

More information about the linux-user mailing list