koacamper has asked for the wisdom of the Perl Monks concerning the following question:
Thank you so much for any assistance you can give.open DATA,$data; $line=<DATA>; @fields=split('\|',substr($line,0,index($line,";"))); %data=(); while (<DATA>) { my(@flds)=@fields; shift(@flds); my(@temp)=split('\|',substr($_,0,index($_,";"))); my($id)=shift(@temp); while ($#flds>-1) { if ($temp[0] eq "no") { $temp[0]=""; } $data{$id}{shift(@flds)}=shift(@temp); } } close DATA; print "Content-type: text/html\n\n"; open TMPL,$catalog; while (<TMPL>) { $line=$_; chop($line); while ($line=~/^(.*?)<!thumb=(.*?)>(.*)$/) { print $1; $id=$2; $line=$3; if ($data{$id}{'thumb'} ne "") { print "<a href=$show_url?database=database&action=view_product +&productID=$2&category=$data{$id}{'Category'}>\n"; print "<img src=${thumb_src}$data{$id}{'thumb'} border=$border + hspace=0 vspace=0 alt='$alt_text $data{$id}{'Name'}' height=65 width +=65></a>"; } if ($data{$id}{'Name'} ne "") { print "<br><font face='$font_face' size=$font_size><SMALL> $da +ta{$id}{'Name'}<BR></SMALL></FONT><font color=red size=+1>"; print '$', "\n"; print "$data{$id}{'Price'}"; } } print $line,"\n"; } close TMPL;
Edit kudra, 2001-09-05 Elaborated on subject which was 'Database question'
|
|---|