User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 391,667 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,927 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 124 | Replies: 1
Reply
Join Date: Mar 2008
Posts: 1
Reputation: dark06 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
dark06 dark06 is offline Offline
Newbie Poster

help guys

  #1  
Mar 28th, 2008
  1. <?
  2. $c = $_POST['col'];
  3. $r = $_POST['rw'];
  4. ?>
  5.  
  6. <?
  7. for($cvchk = 1; $cchk<= $c; $cchk ++)
  8. {
  9. echo $cchk."<br>";
  10.  
  11. for($rchk = 1; $rchk<= $r; $rchk ++)
  12. {
  13. echo $rchk." ";
  14. }
  15. }
  16.  
  17. ?>
i don't know what is wrong with this one
i want the output to become this one

1 2 3 4
2 3 4 1
3 4 1 2
4 1 2 3

i really kinda new with this thanks a lot guys

guys can you help me out with this one..
Last edited by peter_budo : Mar 30th, 2008 at 4:48 am. Reason: [icode] is for one line of code, [code] is for multiple lines
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Feb 2008
Location: Gurgaon India
Posts: 64
Reputation: nikesh.yadav is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 9
nikesh.yadav's Avatar
nikesh.yadav nikesh.yadav is offline Offline
Junior Poster in Training

Re: help guys

  #2  
Mar 28th, 2008
Your answer

<? 
$c = $_POST['col'];
$r = $_POST['rw'];
?>

<? 

for($cchk = 1; $cchk<= $c; $cchk ++)
{
	echo $cchk."";
	for($rchk = 1; $rchk<= $r; $rchk ++)	{ 
	
	
		if ($rchk  > $cchk){			echo $rchk;		}

	
	
	}
	for($rchk = 1; $rchk<= $r; $rchk ++)
	{ 
		if ($rchk  < $cchk){			echo $rchk;		}		
		
	}
	echo "<br> ";
	
	
}

?>
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb PHP Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 1:54 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC