Input checkbox name converts period signs into underlines on post

Posted by Rakoon on Stack Overflow See other posts from Stack Overflow or by Rakoon
Published on 2010-05-23T11:31:15Z Indexed on 2010/05/23 11:40 UTC
Read the original article Hit count: 217

Filed under:
|

Hello

I am working on an image gallery at the moment. When a user is logged in, an x appears over each image and a checkbox next to it to enable the user to delete that image. Only if the checkbox is checked will the image be deleted.

They are both in a (one for each image in the gallery), the small image "x.gif" is an input type="image" that submits the $_POST form. The checkbox inherits the name of the image and is to prevent accidentally pressing the x button and deleting an image.

The problem is that the checkbox name, upon posting it gets converted from (for instance)

"Image.jpg" to "Image_jpg"

When i test it with print_r($_POST);

Should I create code for replacing _jpg or _gif into .jpg and .gif after the post or is there a way to make it possible to use period signs in input names?

Any help is greatly appreciated.

© Stack Overflow or respective owner

Related posts about php

Related posts about forms