HTTP_USER_AGENT=Mozilla/4.0 (compatible; MSIE 6.0; Windows 98)
SERVER_SIGNATURE=<ADDRESS>Apache/1.3.27 Server at localhost Port 80</ADDRESS>
SERVER_SOFTWARE=Apache/1.3.27 (Win32) PHP/4.2.3 mod_perl/1.27_01-dev
Perl-code:
#!C:/phpdev/Perl/
print "Content-type:text/html\n\n";
my ($value, $name, $pair, $buffer, $FORM, $cat)='';
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $buffer);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$FORM{$name} = $value;
}
$cat =$FORM{'cat'};
use DBI;
my $dsn = 'DBI:mysql:images:localhost';
my $db_user_name = 'root';
my $db_password = '';
my ($id, $password);
my $dbh = DBI->connect($dsn, $db_user_name, $db_password);
if ($FORM{'cat'} eq '') {
$sth = $dbh->prepare("SELECT turl,gurl FROM featured_images") or dienice ("Can't open table: ",$dbh->errmsg);
}
else {
$sth = $dbh->prepare("SELECT turl,gurl FROM featured_images WHERE category=\"$cat\"") or dienice ("Can't open table: ",$dbh->errmsg);
}
$sth->execute;
print "<center><table border=0><tr>\n";
while (($turl,$gurl)=$sth->fetchrow) {
print "<td><a href=\"$gurl\"><img src=\"$turl\" width=\"95\" height=\"140\"></a></td>\n";
}
print "</tr></table>\n";
$dbh->disconnect;
exit();
sub dienice {
my($msg) = @_;
print "Error\n";
print $msg;
exit;
}
Welcome to WebmasterWorld [webmasterworld.com]!
Just a question...
Have you tried flushing your browser's cache between requests?
If this clears up the problem, you'll need to add a cache-control header to the server response, or perhaps use "static-looking" URLs to reference the thumbs, and then use mod_rewrite or similar to translate that to a script call. This would allow caching of the various thumbnail-populated pages as if they were separate "real" html pages.
Your comment about "works on the first try" is the reason I'm asking about cache issues. That and the fact that I'm no PERL guru... :)
Jim