The directory structure of the server is:
home dir: C:\inetpub\wwwroot\
scripts dir: C:\inetpub\scripts\ (alias \scripts)
script I want to execute is needed to generate frames html, depending on
user machine's screen resolution, to send it to client (for centering the
page in the screen)
JavaScript follows:
#<body bgcolor="#99CC00" class="body" topmargin="0" leftmargin="0"
onload="SInfo();">
#<script language="JavaScript"><!--
#function SInfo(){
#UInfo.ResX.value=screen.width;
#UInfo.ResY.value=screen.height;
#UInfo.submit();}
#//--></script>
#<form method="POST" name="UInfo" action="/scripts/lv.pl">
#<input type="hidden" name="ResX" value="640"><input type="hidden"
name="ResY" value="480">
#<input type="hidden" name="PID" value="1">
#</form>
#</body>
PERL follows:
_________________________________________________
sub urldecode{
local($value)=@_;
$value=~s/\+/ /g;
$value=~s/%([a-fA-F0-9]{2})/pack ('C',hex($1))/ge;
return $value
}
sysread(STDIN,$Buffer,$ENV{'CONTENT_LENGTH'});
@Pairs=split(/&/,$Buffer);
foreach(@Pairs){
if(/^ResX=(.*)/){$ResX=&urldecode($1);}
elsif (/^ResY=(.*)/){$ResY=&urldecode($1);}
elsif (/^PID=(.*)/){$PID=&urldecode($1);}
}
if ($ResX>800){$LSize=($ResX-780)/2+150;}
elsif ($ResX<=800){$LSize=152;}
open (VST, ">>visits.txt") || die("can't open datafile: $!");
print VST
$PID."%".$ResX."x".$ResY."%".$ENV{REMOTE_HOST}."%".$ENV{HTTP_USER_AGENT}."%"
.localtime."\n";
close (VST);
print "Content-Type: text/html\n\n";
print <<EOD;
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1257">
<meta http-equiv="Content-Language" content="lv">
<meta name="Author" content="KN dati Ltd.">
<meta name="Description" content="LEMON.LV - jaun�k�s zi�as latvie�u valod�,
Interneta katalogs, chat, sludin�jumi, sp�les, horoskopi, laika zi�as, ###
DZEL�U BIR�A ###">
<meta name="Keywords" content="lemon, zi�as, izklaide, rekl�ma, horoskopi,
e-komercija , politika, Latvija, R�ga, Baltija, Respublika, dzel�u bir�a,
zi�as latvie�u valod�, sp�les, ekonomika, bizness, lats, val�tu kursi,
sludin�jumi, sabiedr�ba, sports, kult�ra, krimin�lzi�as, celebrity, celebs,
fotogr�fijas, foto, shop, slaven�bas, m�zika, filmas, kino, zin�tne,
atkl�jumi, datori, Internets, sekss, java, v�rda dienas, jaut�jums, vald�ba,
latvie�i, krievi, baltic, news, Riga, Latvian, politics, economy,
government, latvians, computer news, computers, program, internet, web, www,
world wide web, datorkursi, science, invention, research, discovery, mp3,
fun, curious, strange, chat, audio, video, sms, �szi�as">
<title>www.lemon.lv</title>
<link rel="stylesheet" TYPE="text/css" HREF="styles.css">
<link rel="SHORTCUT ICON" HREF="favicon.ico">
</head>
<frameset framespacing="0" border="0" cols="$LSize,*" frameborder="0">
<frame name="left" scrolling="no" noresize target="rtop" src="\/left.shtm"
marginwidth="0" marginheight="0">
<frameset rows="45,*">
<frame name="Search" target="rbottom" src="\/top.htm" scrolling="no"
noresize marginwidth="0" marginheight="0">
<frame name="Great" target="_self" src="\/central.htm" scrolling="yes"
marginwidth="0" marginheight="0">
</frameset>
<noframes>
<body>
<p>This page uses frames, but your browser doesn't support them.</p>
</body>
</noframes>
</frameset>
</html>
EOD
_________________________________________________
but I think the problem is not in this script, because no script gives the
same error...
Any ideas?
Kaspars
_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web