#!/usr/bin/perl -w
#  test.pl?img=20091016_nawarat_in_liverpool_004.jpg
#  perl -wcT show.do 
# ja som /med

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 $HEADER = "";
# my $MY_FILE_NAME = "";

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

# tuto si nacitam hromadne matatage
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 $! ;

# nacitam headawer
my $HEADER_file = "/web/public/thajsko.in.th/reklamy/header";
open( HEADER, "< $HEADER_file" ) or die "Can't open $META_file : $!";
my @hlavicka = <HEADER>;
close(HEADER) or die $! ;


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

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



print <<ENDHTML;
<html><head>
<title>Show my pictures | www.thajsko.in.th</title>
@lines
</head>
<body>
<div style="text-align: center;">
@hlavicka
<a href="$from1"><img src="http://www2.nsbackup.info/buttons/goback.png "border="0" </a> </a> 
</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.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>

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>

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>"; 

