<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1000879" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1000879</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/simple-script#comment-1003754</link>
    <description> &lt;p&gt;I was just trying to keep it simple for him japhy..that&#039;s the way I would&#039;ve done it though if I needed it for myself..&lt;/p&gt;
&lt;p&gt;------------------&lt;br /&gt;
Gil Hildebrand, Jr.&lt;br /&gt;
The Web Development Genius of the 21st Century&lt;br /&gt;
Boardzilla Programmer&lt;/p&gt;
 </description>
     <pubDate>Thu, 16 Dec 1999 03:35:00 +0000</pubDate>
 <dc:creator>Gil</dc:creator>
 <guid isPermaLink="false">comment 1003754 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/simple-script#comment-1003753</link>
    <description> &lt;p&gt;Gil&#039;s is fine as long as you&#039;re only looking for HTML files.&lt;/p&gt;
&lt;p&gt;In retrospect, the program doesn&#039;t need taint checking, since you&#039;re not using the filename in a system command.&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Code Sample:&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;#!/usr/bin/perl -w&lt;br /&gt;&lt;br /&gt;use strict;&lt;br /&gt;my $file = $ARGV[0];&lt;br /&gt;&lt;br /&gt;$file .= &amp;quot;.html&amp;quot; if $file !~ /\.\w+$/;&lt;br /&gt;print &amp;quot;Location: &amp;quot;, (&lt;br /&gt;&amp;nbsp; -e $file ? $file : &amp;quot;error.html&amp;quot;&lt;br /&gt;), &amp;quot;\n\n&amp;quot;;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;------------------&lt;br /&gt;
--&lt;br /&gt;
MIDN 4/C PINYAN, NROTCURPI, USNR&lt;/p&gt;
 </description>
     <pubDate>Thu, 16 Dec 1999 01:53:00 +0000</pubDate>
 <dc:creator>japhy</dc:creator>
 <guid isPermaLink="false">comment 1003753 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/simple-script#comment-1003752</link>
    <description> &lt;p&gt;Not sure why mine didn&#039;t work, I just tried it again using&lt;br /&gt;
server.com/Cgi-Bin/test.cgi?html=yahoo&lt;/p&gt;
&lt;p&gt;and it seemed to work fine.  Might as well use Gil&#039;s though, nice and short.&lt;/p&gt;
&lt;p&gt;------------------&lt;br /&gt;
&lt;strong&gt;A &#039;jiffy&#039; is an actual unit of time for 1/100th of a second.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;[This message has been edited by robp (edited 15 December 1999).]&lt;/p&gt;
 </description>
     <pubDate>Thu, 16 Dec 1999 01:36:00 +0000</pubDate>
 <dc:creator>Rob Pengelly</dc:creator>
 <guid isPermaLink="false">comment 1003752 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/simple-script#comment-1003751</link>
    <description> &lt;p&gt;Here&#039;s a small script, half the size of the others, that actually works simply.&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Code Sample:&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;#!/usr/bin/perl&lt;br /&gt;if(-e &amp;quot;$ENV{QUERY_STRING}.html&amp;quot;)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; print &amp;quot;Location: $ENV{QUERY_STRING}.html&amp;quot;;&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; print &amp;quot;Location: error.html&amp;quot;;&lt;br /&gt;}&lt;br /&gt;exit;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;------------------&lt;br /&gt;
Gil Hildebrand, Jr.&lt;br /&gt;
The Web Development Genius of the 21st Century&lt;br /&gt;
Boardzilla Programmer&lt;/p&gt;
 </description>
     <pubDate>Thu, 16 Dec 1999 01:17:00 +0000</pubDate>
 <dc:creator>Gil</dc:creator>
 <guid isPermaLink="false">comment 1003751 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/simple-script#comment-1003750</link>
    <description> &lt;p&gt;I&#039;m sorry robp, but your code didn&#039;t work.&lt;/p&gt;
&lt;p&gt;For your information, I&#039;m entering the URL directly into the browser.&lt;/p&gt;
&lt;p&gt;------------------&lt;br /&gt;
&lt;a href=&quot;http://www.goodbookmarks.com&quot; class=&quot;bb-url&quot;&gt;Goodbookmarks.com&lt;/a&gt; - Daily updates of good and honest website, plus a daily joke!&lt;br /&gt;
&lt;a href=&quot;http://www.goodbookmarks.com/Submit_URL/submit_url.html&quot; class=&quot;bb-url&quot;&gt;Submit Your Site Now!&lt;/a&gt;&lt;/p&gt;
 </description>
     <pubDate>Thu, 16 Dec 1999 00:40:00 +0000</pubDate>
 <dc:creator>jackchen</dc:creator>
 <guid isPermaLink="false">comment 1003750 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/simple-script#comment-1003749</link>
    <description> &lt;p&gt;there&#039;s 2 possible solutions, don&#039;t if they&#039;ve beent tested though.  &lt;img src=&quot;http://www.webmaster-forums.com/ubb/wink.gif&quot; alt=&quot;&quot; class=&quot;bb-image&quot; /&gt;&lt;/p&gt;
&lt;p&gt;------------------&lt;br /&gt;
&lt;strong&gt;Get paid to surf, email, and everything else online! 75 hrs a month at 55+ cents an hour! Beats AllAdvantage Easily. &lt;a href=&quot;http://www.getpaid4.com?fair&quot; class=&quot;bb-url&quot;&gt;CLICK 4 DETAILS&lt;/a&gt;&lt;br /&gt;
&lt;/strong&gt;&lt;/p&gt;
 </description>
     <pubDate>Wed, 15 Dec 1999 20:19:00 +0000</pubDate>
 <dc:creator>fairhousing</dc:creator>
 <guid isPermaLink="false">comment 1003749 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/simple-script#comment-1003746</link>
    <description> &lt;p&gt;i could write something like that and i&#039;m brain dead when it comes to cgi compared to some of these guys.  &lt;img src=&quot;http://www.webmaster-forums.com/ubb/wink.gif&quot; alt=&quot;&quot; class=&quot;bb-image&quot; /&gt;&lt;/p&gt;
&lt;p&gt;------------------&lt;br /&gt;
&lt;strong&gt;Get paid to surf, email, and everything else online! 75 hrs a month at 55+ cents an hour! Beats AllAdvantage Easily. &lt;a href=&quot;http://www.getpaid4.com?fair&quot; class=&quot;bb-url&quot;&gt;CLICK 4 DETAILS&lt;/a&gt;&lt;br /&gt;
&lt;/strong&gt;&lt;/p&gt;
 </description>
     <pubDate>Wed, 15 Dec 1999 12:40:00 +0000</pubDate>
 <dc:creator>fairhousing</dc:creator>
 <guid isPermaLink="false">comment 1003746 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/simple-script#comment-1003745</link>
    <description> &lt;p&gt;Can someone here write a simple Perl script for me?&lt;/p&gt;
&lt;p&gt;Let&#039;s say someone enter&lt;br /&gt;
&quot;awards.cgi?yahoo&quot;, then the script will look for a file called &quot;yahoo.html&quot; in the same directory.&lt;/p&gt;
&lt;p&gt;The query is the filename, the default extension will be html. &lt;/p&gt;
&lt;p&gt;And if someone types &quot;awards.cgi?yahoo&quot;, but the script can&#039;t find yahoo.html, then I would like the script to load an error.html. &lt;/p&gt;
&lt;p&gt;All .html will be in the same directory as the CGI. &lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;
&lt;p&gt;------------------&lt;br /&gt;
&lt;a href=&quot;http://www.goodbookmarks.com&quot; class=&quot;bb-url&quot;&gt;Goodbookmarks.com&lt;/a&gt; - Daily updates of good and honest website, plus a daily joke!&lt;br /&gt;
&lt;a href=&quot;http://www.goodbookmarks.com/Submit_URL/submit_url.html&quot; class=&quot;bb-url&quot;&gt;Submit Your Site Now!&lt;/a&gt;&lt;/p&gt;
 </description>
     <pubDate>Wed, 15 Dec 1999 07:31:00 +0000</pubDate>
 <dc:creator>jackchen</dc:creator>
 <guid isPermaLink="false">comment 1003745 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/simple-script#comment-1003748</link>
    <description> &lt;p&gt;Adhering more closely to the specs given, I offer this potential solution:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Code Sample:&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;#!/usr/bin/perl -Tw&lt;br /&gt;&lt;br /&gt;use strict;&lt;br /&gt;my $file = $ARGV[0];&amp;nbsp; # yahoo, for instance&lt;br /&gt;&lt;br /&gt;# this regex &amp;quot;detaints&amp;quot; the $file variable,&lt;br /&gt;# since we don&amp;#039;t want to let it be anything&lt;br /&gt;# dangerous&lt;br /&gt;($file) = $file =~ /^(\w+(?:\.\w+)?)$/;&lt;br /&gt;&lt;br /&gt;# $file will be defined if it&amp;#039;s ok&lt;br /&gt;print(&amp;quot;Location: error.html\n\n&amp;quot;), exit&lt;br /&gt;&amp;nbsp; unless defined $file;&lt;br /&gt;&lt;br /&gt;# add the default .html extension&lt;br /&gt;$file .= &amp;quot;.html&amp;quot; if $file !~ /\.\w+$/;&lt;br /&gt;&lt;br /&gt;# this assumes, like you said, that the HTML&lt;br /&gt;# files are in the same directory as the CGI&lt;br /&gt;# program -- be sure your server allows this&lt;br /&gt;print(&amp;quot;Location: $file\n\n&amp;quot;), exit&lt;br /&gt;&amp;nbsp; if -e $file;&lt;br /&gt;&lt;br /&gt;print &amp;quot;Location: error.html\n\n&amp;quot;;&lt;br /&gt;&lt;br /&gt;__END__&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;------------------&lt;br /&gt;
--&lt;br /&gt;
MIDN 4/C PINYAN, NROTCURPI, USNR&lt;/p&gt;
&lt;p&gt;[This message has been edited by japhy (edited 15 December 1999).]&lt;/p&gt;
 </description>
     <pubDate>Wed, 15 Dec 1999 05:58:00 +0000</pubDate>
 <dc:creator>japhy</dc:creator>
 <guid isPermaLink="false">comment 1003748 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
