spires Posted September 1, 2006 Share Posted September 1, 2006 Changing the input name value with every pass of a loop.I've been trying to do:$i +=0;<input name="'.$i.'">then input_name = $_POST[''.$i.''];in the header to get the data. Does anyone have any ideas on how to do this? Link to comment https://forums.phpfreaks.com/topic/19347-changing-a-name-with-every-pass-of-a-loop/ Share on other sites More sharing options...
Jenk Posted September 1, 2006 Share Posted September 1, 2006 [code]<?phpforeach (array_keys($_POST) as $input_name) { //do something with $input_name}?>[/code] Link to comment https://forums.phpfreaks.com/topic/19347-changing-a-name-with-every-pass-of-a-loop/#findComment-83954 Share on other sites More sharing options...
spires Posted September 1, 2006 Author Share Posted September 1, 2006 Its ok, I've just worked it out, i didn't realise you use the value tag on checkboxs.Thanks anywayinput<input name="$i" type="checkbox" id="$i" value="'.$srow['subs_id'].'">head$s = $_POST['$i']; Link to comment https://forums.phpfreaks.com/topic/19347-changing-a-name-with-every-pass-of-a-loop/#findComment-83956 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.