PDA

Click to See Complete Forum and Search --> : perl dbi


nprimex1
Apr 1st, 2006, 05:41 AM
Hi,

I have a drop down JUMP menu on the home page which is setup so that the values in it are called from the database. When clicked on a value, it opens a new URL and the value is added at the end of the URL as the query.

The problem here now is there are some entries which have spaces in them ... and when clicked on, it opens up a URL with only the first word in the name.

here's the code for the values in the jump menu:



BEGSTATE
##############################################

my @owns = ();
my $fnd = 0;

while(($customer) = $sth_state->fetchrow_array)
{
$fnd = 0;
foreach my $tmp (@owns)
{
if($tmp eq $customer)
{
$fnd = 1;
last;
}
}
if($fnd == 0)
{
push(@owns, $customer);
print "<option value=http://www.blah.com/Eng/cgi_bin/filter_customer.pl?$customer>$customer</option>"
}
}


##############################################


The code above has been written so that it doesn't display duplicate entries of the same name. But I'd like to modify it some more now so that it includes the whitespace and hte other words in the name when opening up a new page.

I've tested the output page and added spaces (%20) in the URL and it does display all the entries properly... so I know there's nothing realy wrong with the output page.


Thanks for any advice.