Hi abbeman
I have pasted the whole script below in the hope you can help further.. Ive added in as you said at the bottom on the loop just before printing the URL, however netscape is still showing the URL with spaces and gives it as a bad reqest.
Example..
works Ok as the link has the space replaced with a + however at the bottom of the page the next page links are still using a space rather than replacing it with %20
Thanks if you can help
Rob
#!/usr/bin/perl
use CGI;
$req = new CGI;
$keywordpara = $req->param('Keywords');
$datadir = "/home/oshjosh/abacus-gallery.com/
open(FILE,"$datadir/data.log"

;
@data = <FILE>;
close(FILE);
print "content-type:text/html\n\n";
$num = @data;
$result=0; $i=0; $j=0; $a=0;
foreach $data (@data) {
($id,$simage,$bimage,$artist,$ref,$size,$desc,$price,$title,$display,$Category,$Keywords) = split(/::/, $data);
if (($artist =~ /\b$keywordpara/i)||($title =~ /\b$keywordpara/i)) {
#if (($Category eq $categorypara)) {
$result++;
}
}
$page = $req->param('page');
if ($page eq '') { $page=0;}
else { $line = $page*6; }
######header########
open(FILE,"top.txt"

;
@header = <FILE>;
close(FILE);
foreach $header (@header) {
print "$header";
}
#####3##############
print "<table><tr><td width=\"39\" valign=\"top\" align=\"left\"></td><td width=\"409\" valign=\"top\" align=\"left\"><span class=\"title\">$keywordpara<br> </span><img src=\"
width=\"260\" height=\"11\"></td><td width=\"326\" valign=\"top\" align=\"left\"></td></tr></table><br><br>";
#start Bonnard Testimonial
if ($keywordpara eq "Pierre Bonnard"

{
print "<center>\"Thank you so much for a wonderful painting. Bonnard is my favorite artist and now I own a perfect reproduction.<br> It arrived on time just as you promised.\" <i><font color=\"#FF0000\">Mario Schiavonne, Milan, Italy</font></i>.</center><br><br>";
}
#end changes Bonnard Testimonial
#start Monet Testimonial
if ($keywordpara eq "Claude Monet"

{
print "<center>\"My designer recommended you and I am so glad she did. The Monet painting is fabulous <br>and I will for sure be ordering another very shortly. A fantastic painting! Thank you.\" <i><font color=\"#FF0000\">Betsey Drover, Michigan Il</font></i>.</center><br><br>";
}
#end changes Monet Testimonial
#start Warhol Testimonial
if ($keywordpara eq "Andy Warhol"

{
print "<center>\"My wife and I were truly delighted to receive our \"Warhol Shoes\" from you. <br>It is an excellent reproduction for which we are most grateful. \" <i><font color=\"#FF0000\">Robert and Sarah Mullen, Leicester. UK</font></i>.</center><br><br>";
}
#end changes Warhol Testimonial
#start Edward Hopper Testimonial
if ($keywordpara eq "Edward Hopper"

{
print "<center>\"My painting arrived this morning. You have captured the light perfectly; it's an excellent piece of work.<br> Thank you so much. \" <i><font color=\"#FF0000\">Abrams, Charleston. (Hopper's Sunday Morning)</font></i>.</center><br><br>";
}
#end Edward Hopper Testimonial
#start Paul Gauguin Testimonial
if ($keywordpara eq "Paul Gauguin"

{
print "<center>\"Dear Sirs, A few months back I ordered Tahitian Women by Paul Gauguin and I now wish to order Tahitian Mountains as I am so pleased with the first one. I look forward to receiving this painting soon. \" <i><font color=\"#FF0000\">Fiona McNally, Fulham, London</font></i>.</center><br><br>";
}
#end Paul Gauguin Testimonial
#start Tamara de Lempicka Testimonial
if ($keywordpara eq "Tamara de Lempicka"

{
print "<center>\"Hi Katie, I just received my Auto-Portrait reproduction of Tamara de Lempicka's work. How do you do it? It's amazing, you've been so sweet and patient answering all my questions and I am thrilled with the result. Thank you again. \" <i><font color=\"#FF0000\">Timothy Charlston, Sacramento</font></i>.</center><br><br>";
}
#end Tamara de Lempicka Testimonial
#start Picasso Testimonial
if ($keywordpara eq "Pablo Picasso"

{
print "<center>\"Hello, My fabulous painting arrived yesterday. I can't wait to get it to the framers and up on the wall. It just adds the finishing touches to my new home. Could you do another Picasso for me? The one I want isn't shown but I can give you all the details? \" <i><font color=\"#FF0000\">Paul and Jackie Lo, Florida</font></i>.</center><br><br>";
}
#end Picasso Testimonial
#start Monet Testimonial
if ($keywordpara eq "Claude Monet"

{
print "<center>\"Great Service and Great Painting. Keep up the good work. \" <i><font color=\"#FF0000\">Cherie Marsden, Nairobi. (Monet and van Gogh)</font></i>.</center><br><br>";
}
#end Monet Testimonial
#start Van Gogh Testimonial
if ($keywordpara eq "Vincent van Gogh"

{
print "<center>\"Great Service and Great Painting. Keep up the good work. \" <i><font color=\"#FF0000\">Cherie Marsden, Nairobi. (Monet and van Gogh)</font></i>.</center><br><br>";
}
#end Van Gogh Testimonial
#start Matisse Testimonial
if ($keywordpara eq "Henri Matisse"

{
print "<center>\"I had to write to congratulate you on the service you offer. My painting (Matisse 'The Dream') arrived was so beautifully packaged and it arrived just on time as you promised it would. I am sure to be in contacting you again.\" <i><font color=\"#FF0000\">Jerome Nibbs, Southampton UK</font></i>.</center><br><br>";
}
#end Matisse Testimonial
#start Klimt Testimonial
if ($keywordpara eq "Gustav Klimt"

{
print "<center>\"My wife has always admired the work of Klimt and The Kiss is her favourites. I am so pleased to have been recommended to you by a friend and chosen this painting for our 10th Wedding anniversary. She is delighted with the present and it will give us both much pleasure over the next 10 years.\" <i><font color=\"#FF0000\">Sincerely, Joshua Cohen, Hampstead, London</font></i>.</center><br><br>";
}
#end Klimt Testimonial
print "<table cellpadding=0 cellspacing=0 width=100%>";
foreach $data (@data) {
($id,$simage,$bimage,$artist,$ref,$size,$desc,$price,$title,$display,$Category,$Keywords) = split(/::/, $data);
if (($artist =~ /\b$keywordpara/i)||($title =~ /\b$keywordpara/i)) {
#if (($Medium eq $mediumpara) && ($Category eq $categorypara)) {
$a++;
if ($a <= $line) {
next;
}
else {
$i++;$j++;
if ($j <= 6) {
if ($i==1) {
print "<tr>";
}
print"<td width=30% align=center valign=top>";
print "<table border=\"1\" cellpadding=\"0\" cellspacing=\"0\" bordercolor=\"#727272\" bordercolorlight=\"#727272\" bordercolordark=\"#727272\"><tr><td><img src=\"$simage\" alt=\"$artist $title\"></a></td></tr></table><br><span class=\"cgi\"><b>\$$price<br><span class=\"cgi\"><b>$artist</b><br>$title</b><br>$size<br><a class=\"cgilink\" href=\"
this Painting<a/><br><br>";
if ($poster eq "1"

{
print "or<br><a class=\"cgilink\" href=\"
poster\">Order a Color Poster</a> <br>$Postersize,\$$posterprice<br>";
}
print "</td>";
if ($i == 3) {
print "</tr><tr height=\"22\"></tr>";
$i = 0;
}
} # end j <=6
else { last;}
} # end show
} # end if
} # end foreach
print "</table>";
print "<CENTER><table><tr><td><span class=\"title\">page - </span> ";
$num_of_page = $result/6;
for($b=0;$b<$num_of_page;$b++)
{
$view = $b+1;
my $string = "test of replace"
$string =~ s/ /%20/g
print "<span class=\"cgifoot\"><a class=\"cgilink\" href=\"
}
print "</span></td></tr></table></CENTER>";
#### footer #######
open(FILE,"bottom.txt"

;
@footer = <FILE>;
close(FILE);
foreach $footer (@footer) {
print "$footer";
}