Jump to content


Photo

changing a name with every pass of a loop


  • Please log in to reply
2 replies to this topic

#1 spires

spires
  • Members
  • PipPipPip
  • Advanced Member
  • 492 posts

Posted 01 September 2006 - 10:45 AM

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?
How to make over $600 a day from AdSense? Discover EXACTLY how he does it in these videos:
http://www.adsense-online.com

#2 Jenk

Jenk
  • Members
  • PipPipPip
  • Advanced Member
  • 778 posts

Posted 01 September 2006 - 11:34 AM

<?php

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

?>


#3 spires

spires
  • Members
  • PipPipPip
  • Advanced Member
  • 492 posts

Posted 01 September 2006 - 11:37 AM

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'];
How to make over $600 a day from AdSense? Discover EXACTLY how he does it in these videos:
http://www.adsense-online.com




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users