Please don't post in HTML if you can help it. It makes quoting

difficult. Thanks. Look for my comments at the end:



Margaret Quinn wrote, on Thursday, November 15, 2001 11:22 AM

 

The code below pulls out a list of fields from a database and populates a list box 
with them.



print qq!<form method="POST" action="whatever.cgi">!;

$SQL = "SELECT DISTINCT MachineNames.MachineName FROM MachineNames WHERE 
NOT(((MachineNames.MachineName)=''))ORDER BY MachineName ASC ";

&SQL; #runs the sql command

 print qq!<font size="3"><b>Recorder</b></font>\n!;

 print qq!<select name="rec">!;



 while ($db->FetchRow()) 

 {

  @values = $db->Data();

  foreach $var (@values) 

  {  

   print("<OPTION VALUE=$var>$var</OPTION>");





-------------------------------------------------

One possible problem is that you're not quoting $var

inside the <OPTION> tag. Try:



   print("<OPTION VALUE='$var'>$var</OPTION>");



and see what that gets you.



Joe



==============================================================

          Joseph P. Discenza, Sr. Programmer/Analyst

               mailto:[EMAIL PROTECTED]

 

          Carleton Inc.   http://www.carletoninc.com

          219.243.6040 ext. 300    fax: 219.243.6060

 

Providing Financial Solutions and Compliance for over 30 Years

 



_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web


Reply via email to