<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1001188" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1001188</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/how-do-i-password-protect-html-file-using-dialup-service#comment-1005164</link>
    <description> &lt;p&gt;If your ISP doesn&#039;t allow you to use .htaccess files to restrict access to a certain folder, then you could use a cgi-script that requires password authentication, and then redirects the user to the protected file. I haven&#039;t done this before but I imagine that it could be accomplished with something like this.&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;code:&lt;/p&gt;
&lt;pre&gt;

#!/usr/bin/perl -w

require &quot;formparser.cgi&quot;; # you need some way to parse the form as well.

if (mode eq &quot;&quot;) {
print &quot;Content-type:text/html\n\n&quot;;
print &quot;&amp;lt;html&amp;gt;&amp;lt;head&amp;gt;&amp;lt;title&amp;gt;PASSWORD FORM&amp;lt;/title&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;&quot;;
print &quot;&amp;lt;form method=&quot;POST&quot; action=&quot;thisscript.cgi?mode=pass&quot;;
print &quot;&amp;lt;input type=&quot;text&quot; name=&quot;username&quot;&amp;gt;&quot;;
print &quot;&amp;lt;br&amp;gt;&amp;lt;input type=&quot;password&quot; name=&quot;password&quot;&amp;gt;&quot;;
print &quot;&amp;lt;input type=&quot;submit&quot; value=&quot;SUBMIT&quot;&amp;gt;&quot;;
print &quot;&amp;lt;/form&amp;gt;&quot;;
print &quot;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&quot;;

if (mode eq &quot;pass&quot;) {
 open (PASSWORDS, &quot;&amp;lt; ../passwords.txt&quot;);
 @passes = &amp;lt;PASSWORDS&amp;gt;;
 close (PASSWORDS);

foreach $item(@passes) {
 if ($pass = $item) {
  $access = &quot;yes&quot;
 }
}

if ($access eq &quot;yes&quot;) {
 redirect # I forget how to redirect???
} else {
print &quot;Content-type:text/html\n\n&quot;;
print &quot;Sorry that password is incorrect&quot;;
}

[/code]

Now this is just a simple script that I typed on the fly so use it as a guide don&#039;t try and use it on the server because it will not execute because I haven&#039;t escaped the quotation marks.

I hope this helps some.
VulKen
&lt;strong&gt;I&#039;m Too Phat&lt;/strong&gt; &lt;/pre&gt;&lt;/blockquote&gt;</description>
     <pubDate>Wed, 28 Jun 2000 14:11:00 +0000</pubDate>
 <dc:creator>Ken Elliott</dc:creator>
 <guid isPermaLink="false">comment 1005164 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
