Click to See Complete Forum and Search --> : table problem


TheLast
08-02-2003, 03:05 PM
hi there

i have a code to get images from a folder and but it in a table but there is a little problem

see this page

http://207.44.236.204/cgi-bin/smile.pl

you will see the table is ok but see this page

http://207.44.236.204/cgi-bin/smile.pl?page2

you will find an error in that table.



i used this code


open(sold,"images/images.cgi");
flock(sold,2);
@pmd = <sold>;
$ps = -1;
$ps2 = 0;


foreach $ps(@lpn){
chop($ps);
$ps++;

if($ps ne 1){
push(@lisv," \<\|\> <b>$om</b>");
}else{
push(@lisv,"<b>$ps2</b>");
}
}

$now = $#pmd-$file[0];
foreach $sete (@pmd) {
$ps++;
$ps2++;

chop($sete);
@qpd = split(/\|/,$pmd[$ps]);
close(sold);


$tell[$ps] = "<img src=\"$imgurl/$qpd[1]\" alt=\"$qpd[2]\" align=\"absbottom\"><br>$qpd[0]";

if ($ps >=$num && $ps <=$num2 ){
if($ps2 <= 6){
push(@ops,"<td align=\"center\">
$tell[$ps]</tr>\n");
}else{
push(@ops,"<td align=\"center\">
$tell[$ps]</td></tr>\n");
$ps2 = 0;
}
}
}




so can you please fix this problem.

CyCo
08-02-2003, 03:48 PM
...looks like you're missing some table tags

if ($ps >=$num && $ps <=$num2 ){
if($ps2 <= 6){
push(@ops,"<td align=\"center\">
$tell[$ps]</td></tr>\n");
}else{
push(@ops,"<td align=\"center\">
$tell[$ps]</td></tr>\n");
$ps2 = 0;
}
}
}

CyCo
08-02-2003, 03:53 PM
...and you are missing opening row tags, too <tr>

Charles
08-02-2003, 04:05 PM
This looks like a good place for the CGI module. See http://www.perldoc.com/perl5.8.0/lib/CGI.html.

TheLast
08-03-2003, 03:09 PM
CyCo


so how can i correct that code