Jump to content

Archived

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

spires

changing a name with every pass of a loop

Recommended Posts

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?

Share this post


Link to post
Share on other sites
[code]<?php

foreach (array_keys($_POST) as $input_name) {
    //do something with $input_name
}

?>[/code]

Share this post


Link to post
Share on other sites
Its ok, I've just worked it out, i didn't realise you use the value tag on checkboxs.

Thanks anyway


input
<input name="$i" type="checkbox" id="$i" value="'.$srow['subs_id'].'">

head
$s = $_POST['$i'];

Share this post


Link to post
Share on other sites

×

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.