You are here: html within php works, but php within html doesnt « PHP Programming Language « IT news, forums, messages
html within php works, but php within html doesnt

Posted by mantrid on 09/02/06 13:19

Below are two different ways of writing the same script. The top one works
but the bottom one displays nothing in the list. Can anyone see why?

<?php
echo "<select name='subcat' style='WIDTH: 95%'><option value=''>Select
one</option>";
while($noticia = mysql_fetch_array($quer)) {
echo "<option value='$noticia[TopicID]'>$noticia[Topic]</option>";
}
echo "</select>";
?>



<select name="subcat" style="WIDTH: 95%">
<option value="">Select one</option>
<?php while($noticia = mysql_fetch_array($quer)) { ?>
<option value="<?php $noticia[TopicID]; ?>"><?php $noticia[Topic];
?></option>
<?php } ?>
</select>

Ian

 

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

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