#!/usr/bin/perl -w

#  test.pl?img=20091016_nawarat_in_liverpool_004.jpg
#  perl -wcT test.do 

use CGI;
# use Carp::Always; # complain loudly
use strict;
my $query = new CGI;
my $browser = $ENV{'HTTP_USER_AGENT'};
my $from1 = $ENV{'HTTP_REFERER'};
my $IP = $ENV{'REMOTE_ADDR'};
my $META = "";
# my $MY_FILE_NAME = "";

# prevzatie mena obrazku
my $MY_FILE_NAME = $query->param('img'); 

my $META_file = "/web/public/thajsko.in.th/reklamy/metatagy";
open( META, "< $META_file" ) or die "Can't open $META_file : $!";
my @lines = <META>;
close(META) or die $! ;

print "Content-type: text/html\n\n";

# kontrola odkial prichadza navsteva
if (!defined $from1 ) {
( $MY_FILE_NAME = "/usr/home/weby/thajsko.in.th/thajsko.gif" );
( $from1 = "http://www.morpheushosting.sk/" );
}


print <<ENDHTML;
<html><head>
<title>Thajsko 2010 pictures | www.thajsko.in.th</title>

@lines

</head>
<body>

<div style="text-align: center;">
<h2>Hi Thajsko visitor!</h2>

<p>Na zmene grafiky aj obsahu sa pracuje. Dakujem za strpenie.</p> 
<a href="$from1"><img src="http://www2.nsbackup.info/buttons/goback.png "border="0" </a> </a> 
</div>


<div style="text-align: center;">




</div>


 
<div style="text-align: center;"><img style=""
 alt="requested img $MY_FILE_NAME " src="print_pic.pl?img=$MY_FILE_NAME"><br>

<a href="http://www.morpheushosting.sk/"><img src="http://www2.nsbackup.info/buttons/web-hosting.png"border="0" </a>
<a href="http://www.thajsko.in.th/"><img src="http://www.thajsko.in.th/thajsko.gif "border="0" </a><br>

<a href="$from1"><img src="http://www2.nsbackup.info/buttons/goback.png "border="0" </a> <br>

<a href='http://www.spreadfirefox.com?from=sfx&amp;uid=288914&amp;t=358'><img src='http://www.spreadfirefox.com/files/images/affiliates_banners/Community-Member-Firefox.png' alt='Spread Firefox Affiliate Button' border='0' /></a>





<a href="http://www.toplist.sk/"><script language="JavaScript" type="text/javascript">
<!--
document.write ('<img src="http://toplist.sk/count.asp?id=1155853&logo=mc&wi='+escape(window.screen.width)+'&he='+escape(window.screen.height)+'" width="88" height="60" border=0 alt="TOPlist" />');
//--></script><noscript><img src="http://toplist.sk/count.asp?id=1155853&logo=mc" border="0"
alt="TOPlist" width="88" height="60" /></noscript></a>


</div>

ENDHTML



print qq{<br> </a>  <p style="text-align: center;">};
# print `uptime`;
print '<br><br>';

print "You are browsing from $IP with $browser <br><br>";

print "\n\n  Server time: ";
print `date`;


print "</body></html>"; 

