You are here: Re: for loop and formatting its output « PHP Programming Language « IT news, forums, messages
Re: for loop and formatting its output

Posted by mantrid on 09/23/06 14:34

"mantrid" <ian.dandav@virgin.net> wrote in message
news:SrbRg.40250$WV2.18238@newsfe2-gui.ntli.net...
> HelloIn the following snippet of code x text fields are generated. I can
> include <br> at the end to split them onto separate lines, but how do I
> modify the code to have two text fields on each line?
>
> for ($x = 1; $x <= $ansperquest; $x++){
> echo "Type Answer ".$x ?><input name="<?php echo 'ansE'.$x; ?>"
size="30"
> type="text"><?php
> }
>
> Thanks
> Ian
>
>


ok
i got it

for ($x = 1; $x <= $ansperquest; $x++){
if ($x % 2 == 0 ){
echo "Type Answer ".$x ?><input name="<?php echo 'ansE'.$x; ?>"
size="30" type="text"><br><?php
}else{
echo "Type Answer ".$x ?><input name="<?php echo 'ansE'.$x; ?>"
size="30" type="text"><?php
}
}

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация