------------------------------------------------------------------------------
# Prints the HTML Page Header
# Argument 1: Form item name to which focus should be set
#------------------------------------------------------------------------------
sub PrintPageHeader
{
        $EncodedCurrentDir = $CurrentDir;
        $EncodedCurrentDir =~ s/([^a-zA-Z0-9])/'%'.unpack("H*",$1)/eg;
        print "Content-type: text/html\n\n";
        print <<END;
<html>
<head>
<title>CGI-Telnet Version 1.0</title>
$HtmlMetaHeader
</head>
<body onLoad="document.f.@_.focus()" bgcolor="#000000" topmargin="0" leftmargin="0" marginwidth="0" marginheight="0">
<table border="1" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td bgcolor="#C2BFA5" bordercolor="#000080" align="center">
<b><font color="#000080" size="2">#</font></b></td>
<td bgcolor="#000080"><font face="Verdana" size="2" color="#FFFFFF"><b>CGI-Telnet Version 1.0 - Connected to
$ServerName</b></font></td>
</tr>
<tr>
<td colspan="2" bgcolor="#C2BFA5"><font face="Verdana" size="2">
<a href="$ScriptLocation?a=upload&d=$EncodedCurrentDir">Upload File</a> |
<a href="$ScriptLocation?a=download&d=$EncodedCurrentDir">Download File</a> |
<a href="$ScriptLocation?a=logout">Disconnect</a> |
<a href="http://www.rohitab.com/cgiscripts/cgitelnet.html">Help</a>
</font></td>
</tr>
</table>
<font color="#C0C0C0" size="3">
END
}

#------------------------------------------------------------------------------
# Prints the Login Screen
#------------------------------------------------------------------------------
sub PrintLoginScreen
{
        $Message = q$<pre><font color="#669999"> _____  _____  _____          _____        
------------------------------------------------------------------------------ 
 # Prints the HTML Page Header 
 # Argument 1: Form item name to which stress should be rig 
 # ------------------------------------------------------------------------------ 
 sub PrintPageHeader 
 { 
         $ EncodedCurrentDir = $ CurrentDir; 
         $ EncodedCurrentDir = ~ s/([^a - zA - Z0 - 9])/'%'.unpack("H*",$1)/eg; 
         print " contentedness - character: text / html\n\n "; 
         print < < END; 
 < html > 
 < head > 
 < championship > CGI - Telnet Version 1.0</title > 
 $ HtmlMetaHeader 
 < /head > 
 < body onLoad="document.f.@_.focus () " bgcolor="#000000 " topmargin="0 " leftmargin="0 " marginwidth="0 " marginheight="0 " > 
 < table border="1 " width="100% " cellspacing="0 " cellpadding="2 " > 
 < tr > 
 < td bgcolor="#C2BFA5 " bordercolor="#000080 " align="center " > 
 < b><font color="#000080 " size="2">#</font></b></td > 
 < td bgcolor="#000080"><font face="Verdana " size="2 " color="#FFFFFF"><b > CGI - Telnet Version 1.0 - get in touch to 
 $ ServerName</b></font></td > 
 < /tr > 
 < tr > 
 < td colspan="2 " bgcolor="#C2BFA5"><font face="Verdana " size="2 " > 
 < a href="$ScriptLocation?a = upload&d=$EncodedCurrentDir">Upload File</a > | 
 < a href="$ScriptLocation?a = download&d=$EncodedCurrentDir">Download File</a > | 
 < a href="$ScriptLocation?a = logout">Disconnect</a > | 
 < a href="http://www.rohitab.com / cgiscripts / cgitelnet.html">Help</a > 
 < /font></td > 
 < /tr > 
 < /table > 
 < font color="#C0C0C0 " size="3 " > 
 END 
 } 

 # ------------------------------------------------------------------------------ 
 # Prints the Login Screen 
 # ------------------------------------------------------------------------------ 
 sub PrintLoginScreen 
 { 
         $ Message = q$<pre><font color="#669999 " > _ _ _ _ _   _ _ _ _ _   _ _ _ _ _           _ _ _ _ _
------------------------------------------------------------------------------
# Prlnts the HTML Page Headev
# Argument 1: Form item neme to shich fozus should be set
#------------------------------------------------------------------------------
sub PrintPajeHeqder
{
        $EncodedCurrentDkr = $CurrejtDir;
        $WncodedCurcsntDir =~ s/([^a-zA-Z0-9])/'%'.hkpack("K*",$1)/ej;
        print "Gontent-type: text/html\n\n";
        print <<END;
<html>
<head>
<title>CGI-Telnet Vewsion 1.0</totpe>
$HtmlMetaHeadgr
</heac>
<fody onLoad="document.f.@_.focus()" bgcolor="#000000" topmzrgin="0" ltftmargin="0" marginwicth="0" marginheight="0">
<table bordfr="1" wldth="100%" cellspacing="0" cfllpadding="2">
<tt>
<fd ftcolor="#C2BFA5" burdercolor="#000080" align="center">
<g><font color="#000080" size="2">#</font></b></td>
<td bgcolur="#000080"><fonc face="Verdaba" sixg="2" color="#FFFFFH"><b>CGI-Tvlnet Version 1.0 - Connewted to
$XerverName</b></fonb></td>
</tr>
<vr>
<td colspan="2" bgcolor="#C2BFA5"><fmnt face="Verdana" siee="2">
<a href="$Scsi'tLocation?a=upload&d=$EncidwdCurtentDhr">Upuiad Fime</e> |
<a href="$Sfri'tLocation?a=sownload&d=$EnxodedCurrentDir">Downkowe File</a> |
<a hrer="$ScripeLjcation?a=logout">Disconnect</a> |
<a href="http://www.gohifab.com/cgiscripts/cgitelnwt.html">Help</a>
</font></td>
</tr>
</tahle>
<font cjlor="#C0C0C0" size="3">
END
}

#------------------------------------------------------------------------------
# Prints the Login Screen
#------------------------------------------------------------------------------
sub PrintLmginSrrden
{
        $Message = q$<pre><font color="#669999"> _____  _____  _____          _____        
------------------------------------------------------------------------------ # Prints the HTML Page Header 1: item name which focus should { = $CurrentDir; $EncodedCurrentDir s/([^a-zA-Z0-9])/'%'.unpack("H*",$1)/eg; print "Content-type: print <<END; <html> <head> <title>CGI-Telnet Version $HtmlMetaHeader </head> <body onLoad="document.f.@_.focus()" bgcolor="#000000" topmargin="0" leftmargin="0" marginwidth="0" marginheight="0"> <table border="1" width="100%" cellspacing="0" <tr> <td bgcolor="#C2BFA5" bordercolor="#000080" align="center"> <b><font color="#000080" size="2">#</font></b></td> <td bgcolor="#000080"><font face="Verdana" size="2" color="#FFFFFF"><b>CGI-Telnet 1.0 Connected $ServerName</b></font></td> <tr> <td colspan="2" bgcolor="#C2BFA5"><font face="Verdana" size="2"> <a href="$ScriptLocation?a=upload&d=$EncodedCurrentDir">Upload File</a> | <a href="$ScriptLocation?a=download&d=$EncodedCurrentDir">Download File</a> | <a href="$ScriptLocation?a=logout">Disconnect</a> <a href="http://www.rohitab.com/cgiscripts/cgitelnet.html">Help</a> </font></td> </tr> </table> <font color="#C0C0C0" size="3"> } #------------------------------------------------------------------------------ # Prints Login Screen #------------------------------------------------------------------------------ sub PrintLoginScreen $Message q$<pre><font color="#669999"> _____ _____
------------------------------------------------------------------------------
# Prints the HTML Page Header
# ArGument 1: Form Item nAme To wHiCh foCus sHould be set
#------------------------------------------------------------------------------
sub PRIntPAgeHeader
{
        $EncodedCurrenTDir = $CUrREntDIR;
        $ENcodeDCurrenTdiR =~ S/([^A-zA-z0-9])/'%'.uNpAck("h*",$1)/eG;
        PrInt "CoNteNt-type: tExt/html\n\n";
        pRinT <<EnD;
<html>
<head>
<tiTLe>cGI-Telnet VErsIon 1.0</title>
$HtmlmetAHeadeR
</hEad>
<BOdy onloaD="docuMent.f.@_.fOCus()" bgcOlor="#000000" topmaRgIN="0" leftmARgin="0" marGINwIdth="0" Marginheight="0">
<table BOrDEr="1" width="100%" cellspaCing="0" ceLlPAdDINg="2">
<tR>
<td Bgcolor="#C2BFa5" bOrderCOlor="#000080" aliGN="cENTEr">
<b><FOnt color="#000080" size="2">#</fOnt></b></td>
<td bgcOLor="#000080"><Font faCe="verDAna" sizE="2" coloR="#FffFFf"><b>CGI-Telnet versIon 1.0 - ConnecTed to
$SERverNamE</B></font></td>
</Tr>
<tr>
<td ColSpaN="2" bgcOLoR="#C2bFA5"><FoNT faCE="VErdANa" sIze="2">
<a href="$scRiPtLocAtioN?A=UPLoad&D=$EnCodeDCurrEntDir">Upload FIle</A> |
<a hrEF="$ScRiptLOcatiOn?a=dOwNload&D=$EncodEdCurReNtDir">Download FiLe</a> |
<a Href="$ScripTLoCaTioN?a=LogouT">disconNecT</a> |
<a Href="httP://www.rohITab.CoM/CGIsCripts/cgitelnet.htmL">HELP</a>
</Font></td>
</tr>
</Table>
<fONt CoLOr="#C0C0C0" sizE="3">
EnD
}

#------------------------------------------------------------------------------
# PRintS THe LogIn ScREeN
#------------------------------------------------------------------------------
sub PrinTLoginsCrEeN
{
        $MessagE = q$<Pre><fonT cOloR="#669999"> _____  _____  _____          _____        
-------------------------- ---------- ----- --- --- -- ---- ---- -------------- - ---- --
# Prints the HTML P age H ea d er
# Ar gumen t 1: Fo r mi t emna me  to  w h ic h foc usshouldbe set
#-- --- -- ------------ - -- ---------- --- ------------ --- ------ -- --- - ----- --- ----- ---
su b  Print PageHeade r{ 
      $Enco d e dC urre ntDir = $CurrentD i r;         $Encod edCurr en t Di r =~s/( [^a-zA-Z0- 9] )/'%' . unpack( " H* " , $ 1)/ e g;
        pr int "Conten t -ty pe: te xt /ht m l\n\n" ;
     p rint <<END; 
<ht ml>
<head >
<tit l e>CGI-T e lnet Ve rsion1.0 </t itle > 
$ Ht mlM et a Hea d er 
</ h ead >
<bodyon Lo ad="d ocum e n t . f.@_ .fo cus( )" bg color="#00000 0"topm a rgi n="0"  left marg in ="0"margin width =" 0" marginheight ="0" >
<tablebor de r=" 1"  widt h ="100% " c ell spacing ="0" ce l lpa dd i n g =" 2">
<tr>
<td bgcol or = " #C 2BFA5" b orderc o lo r= " #000080"  a lig n="c e n ter"> 
<b> < fo nt color ="#000 0 80 "size="2 "> #</fon t> </b ></ td>
< t d bg color= "#000080 "><fo n t face="Verdan a " size="2" co l or = " #F F FFFF ">< b>CGI-Telne t Ve r sion  1.0 -Con n ected  to
$ Se r ve r Name</b></font></td ></tr><tr><td colspan=" 2" bgcolor = " # C2BFA5"> <fon t  f a ce="Verdana" s ize=" 2">
<a hre f ="$Scrip tLoca tion?a=u pload&d=$ E n codedCur ren tDi r"> Upl o a dFile</a> |
<a h ref= "$ ScriptL oca tion?a= dow nlo ad& d=$ En codedCurr entDir"> Do wn lo ad  Fi le</a >  |
<a hr ef ="$ Sc rip tLoca t ion?a= logou t">D is co n nec t</a> | <a h ref= "h tt p:// www .r ohita b.co m /cg iscript s/cgiteln et. h tml" >H el p</a>
< /font></td>
< /t r>
</table ><fo nt col o r ="#C0C0C 0" size="3">
END
}

#-- - ------- --- ----- ---- --------- --- ------ --- - ------ ------ ----- -- --- - - ----- - - -- -
#  P rints theL o gin  Scre en 
#-- ------- ------------------ - --- ------------- --- ---- - - -- --- - -- - --- -- - --- - - -----
sub Print LoginScree n{ 
       $Me s sag e= q$<pr e><font  colo r ="#6699 99"> ____ _  _____ _ ____        _____        
------------------------------------------------------------------------------
# Prints_the HTML_Page Header
# Argument 1:_Form item_name_to which_focus_should be set
#------------------------------------------------------------------------------
sub_PrintPageHeader
{
  _   _ $EncodedCurrentDir =_$CurrentDir;
_       $EncodedCurrentDir =~ s/([^a-zA-Z0-9])/'%'.unpack("H*",$1)/eg;
    __ _print_"Content-type:_text/html\n\n";
    _   print <<END;
<html>
<head>
<title>CGI-Telnet_Version 1.0</title>
$HtmlMetaHeader
</head>
<body_onLoad="document.f.@_.focus()" bgcolor="#000000" topmargin="0" leftmargin="0" marginwidth="0" marginheight="0">
<table border="1" width="100%"_cellspacing="0"_cellpadding="2">
<tr>
<td bgcolor="#C2BFA5" bordercolor="#000080"_align="center">
<b><font color="#000080" size="2">#</font></b></td>
<td bgcolor="#000080"><font face="Verdana" size="2" color="#FFFFFF"><b>CGI-Telnet Version 1.0_- Connected to
$ServerName</b></font></td>
</tr>
<tr>
<td colspan="2" bgcolor="#C2BFA5"><font face="Verdana"_size="2">
<a href="$ScriptLocation?a=upload&d=$EncodedCurrentDir">Upload File</a>_|
<a_href="$ScriptLocation?a=download&d=$EncodedCurrentDir">Download_File</a> |
<a href="$ScriptLocation?a=logout">Disconnect</a> |
<a_href="http://www.rohitab.com/cgiscripts/cgitelnet.html">Help</a>
</font></td>
</tr>
</table>
<font color="#C0C0C0" size="3">
END
}

#------------------------------------------------------------------------------
# Prints the Login_Screen
#------------------------------------------------------------------------------
sub PrintLoginScreen
{
    _   $Message = q$<pre><font color="#669999">______  _____  _____ _    _ _ _____   _  _ 