Jump to content

Php form data


Lyleyboy

Recommended Posts

Hi all,

 

I am fairly sure there is a way to do this but not certain.

How can I detect the data sent via $_POST if I am not sure what the field names will be?

 

The concept is that I'll have a lot of checkboxes with various names and I need to see what has been clicked. The names of the checkboxes will not be the same twice.

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/141578-php-form-data/
Share on other sites

You need to put all of the checkboxes into their own array.

 

<input type="checkbox" name="checkbox[]" value="value" />

 

Then when you submit the form, it will make an array inside of the $_POST array.

 

$_POST['checkbox']

 

Note: I didn't test this exact code, but it should be something very similar.

 

Jeremy

Link to comment
https://forums.phpfreaks.com/topic/141578-php-form-data/#findComment-741084
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.