Jump to content

Recommended Posts

I'm not sure about where to put all the "" in this combo:

				
		for($y=1;$y<=$_POST['expense'];$y++)
		{
		print "<tr><td style='border:0px solid black;'>".$y."
			<input type='text' name='$y'size='10'><b>R</b></input>
<input type='text' name='$y'size='4'></input></td></tr>";
		}

		print "</table>";

 

i need to insert this instead of the second text box but still close up the previous loop:

 

print "<select name='numbers'>";
for($i=1;$i<100;$i++)
{
print "<option value='$i'>$i</option>";
}
print"</select>";

PLEASE HELP!!!

Link to comment
https://forums.phpfreaks.com/topic/147936-dropdown-menu-loop-inside-a-for-loop/
Share on other sites

it's cool i just got it right! its:

for($m=1;$m<=$_POST['income'];$m++)
		{
		print "<tr><td style='border:0px solid black;'>".$m."
			<input type='text' name='$m'size='10'><b>R</b></input>
			<select name='rand'>";
			for($k=1;$k<=100;$k++)
			{
			print "<option value='$k'>$k</option>";
			}
			print "</select></td></tr>";

 

but now how do i get it to count up in 100's not 1's?

it's cool i just got it right! its:

for($m=1;$m<=$_POST['income'];$m++)
		{
		print "<tr><td style='border:0px solid black;'>".$m."
			<input type='text' name='$m'size='10'><b>R</b></input>
			<select name='rand'>";
			for($k=1;$k<=100;$k++)
			{
			print "<option value='$k'>$k</option>";
			}
			print "</select></td></tr>";

 

but now how do i get it to count up in 100's not 1's?

 

instead of $k++ make it $k=$k+100. Tada!

thank! i'll try that again but then i didn't think it worked cuz it took really long to load as if it was counting to infinity or something but maybe i did something wrong, i'll try quick ;D

 

Weird ??? It should work i think.

 

Now you are basically on the same page as i am. I cant figure out part 3, its killing me!!!!  :'( Lemme know if you can do it pleaseeee!  :'(

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.