If the only character you're going to need to convert is a space, you can use
$rec{'Fieldname'} = s/ /+/g;
just before you are going to print out the URL that includes $rec{'Fieldname'}.
If you're going to have other characters that might cause problems (I'm not completely certain what they are, but I'd be hesitant about anything other than numbers and letters) you can use a subroutine to convert them all.
Code:
sub urlencode {
# --------------------------------------------------------
# Escapes a string to make it suitable for printing as a URL.
#
my($toencode) = shift;
$toencode =~ s/([^a-zA-Z0-9_\-.])/uc sprintf("%%%02x",ord($1))/eg;
return $toencode;
}
Put the above somewhere in db.cgi and then to use it,
$rec{'Fieldname'} = &urlencode($rec{'Fieldname'});
Again, you'll want to do this just before you print out the url.
------------------
JPD