home *** CD-ROM | disk | FTP | other *** search
/ Neil's C++ Stuff / 2014-11-mediatemple-neilstuff.zip / default.asp < prev    next >
Text File  |  2014-11-20  |  7KB  |  208 lines

  1. <%@Language=JScript%><html>
  2. <head>
  3. <!--
  4.  
  5. History by NeilO on February 2nd, 2007
  6.  
  7. index.php == support for old URL's, from the failed "v2.0" of NeilStuff.com
  8.  
  9. I wish I had never done this, but it's done now and people have linked to it.
  10. There existed a version that never fully gelled called "v2.0" of this site.
  11. It had an XML file that defined all of the sections and pages and downloads;
  12. index.php was a master script which output any of the files based on the 'p'
  13. parameter AND rewrote links inside itself to do so.  In this way it would add
  14. header, footer, counter, and other components.
  15.  
  16. Now I'm using flat HTML pages, for good reason, but too late of course.  This
  17. is NOT actually PHP code, it is ASP.  IIS has been configured to process *.php
  18. as Active Server Pages.
  19.  
  20. Previously this page would use Response.Redirect(), but I couldn't then use my
  21. normal counter (currently Tracksy) to figure out who was linking to them.  So
  22. I've changed it to output an actual page that directs the user to the new
  23. location.
  24.  
  25. -->
  26. <%
  27.  
  28.     var Title = "Neil's Stuff";
  29.     var ToUrl = "http://www.neilstuff.com";
  30.     var Note = "";
  31.     var Known = true;
  32.     var p = -1;
  33.  
  34.     if (Request.QueryString("p").Count > 0)
  35.         p = parseInt(Request.QueryString("p").Item(1));
  36.  
  37.     if (Request.QueryString("uq").Count > 0)
  38.     {
  39.         switch (Request.QueryString("uq").Item(1))
  40.         {
  41.             case "cpp":
  42.                 p = 1;
  43.                 break;
  44.  
  45.             default:
  46.                 Known = false;
  47.                 break;
  48.         }
  49.     }
  50.  
  51.     switch (p)
  52.     {
  53.         case -1:
  54.         case 0:
  55.             Note = " (home page)";
  56.             ToUrl += "/";
  57.             break;
  58.  
  59.         case 1:
  60.             Title = "Neil's C++ Stuff";
  61.             ToUrl += "/cpp/";
  62.             break;
  63.  
  64.         case 36:
  65.             Title = "Neil's Guide to C++";
  66.             ToUrl += "/guide_to_cpp/";
  67.             break;
  68.  
  69.         case 55:
  70.             Title = "Neil's C++ Stuff - Pointer Variables";
  71.             ToUrl += "http://www.neilstuff.com/cpp/pointers.htm";
  72.             break;
  73.         
  74.         case 56:
  75.             Title = "Neil's C++ Stuff - Structures";
  76.             ToUrl += "http://www.neilstuff.com/cpp/structs.htm";
  77.             break;
  78.         
  79.         default:
  80.             Known = false;
  81.             ToUrl += "/";
  82.             break;
  83.     }
  84.  
  85. %>
  86. <!--[@beg@ meta]--><meta name="robots" content="noindex,nofollow" /><!--[@end@ meta]-->
  87. <title>Go To <%= Title %></title>
  88. </head>
  89. <body>
  90. <!--[@beg@ header]--><DIV ID="idNeilAd" STYLE="float:right; background-color:#DFDFFF; border:1px solid black; width:160px">
  91.  
  92.     <SCRIPT LANGUAGE="JavaScript"><!--
  93.  
  94.     function OnFeedback()
  95.     {
  96.         document.feedback.subj.value += document.location.href;
  97.         document.feedback.redir.value += ("?url=" + encodeURIComponent(document.location.href));
  98.     }
  99.  
  100.     // --></SCRIPT>
  101.  
  102.     <DIV STYLE="text-align:center;background-color:#000000;color:#FFFFFF; padding:0.2em; font:11pt Arial Narrow,Arial,Sans Serif;font-weight:bold">Feedback</DIV>
  103.     <FORM STYLE="margin:0px; padding:0px" NAME="feedback" ACTION="http://bin.neilstuff.com/mailpost.asp" METHOD="POST" ONSUBMIT="OnFeedback()">
  104.     <INPUT TYPE="HIDDEN" NAME="to" VALUE="neil" />
  105.     <INPUT TYPE="HIDDEN" NAME="subj" VALUE="[NeilStuff.com] " />
  106.     <INPUT TYPE="HIDDEN" NAME="redir" VALUE="http://www.neilstuff.com/feedback.htm" />
  107.  
  108.     <DIV STYLE="font:12pt Arial; width:160px;padding:2px">
  109.         <INPUT ID="idFrom" STYLE="float:right; font:8pt Arial; width:120px" TYPE="TEXT" NAME="from" />
  110.         You:
  111.     </DIV>
  112.  
  113.     <DIV STYLE="text-align:right; padding:2px; clear:both"><TEXTAREA ID="idFeedback" NAME="text" STYLE="font:8pt Arial; width:120px" COLS="30" ROWS="5"></TEXTAREA></DIV>
  114.  
  115.     <DIV STYLE="text-align:right"><INPUT ID="idSubmit" TYPE="SUBMIT" VALUE="Send Feedback" STYLE="font:8pt Arial; width:120px" /></DIV>
  116.  
  117.     </FORM>
  118.  
  119.     <DIV STYLE="text-align:center;background-color:#000000;color:#FFFFFF; padding:0.2em; font:11pt Arial Narrow,Arial,Sans Serif;font-weight:bold">Copyright</DIV>
  120.  
  121.     <DIV STYLE="margin:0.5em;font:10pt Arial,Sans Serif">Content created by <A HREF="mailto:webmaster@neilstuff.com">Neil C. Obremski</A>.  Please make a link to this page if you copy any portion of these works.
  122.     </DIV>
  123.  
  124.     <DIV STYLE="text-align:center;background-color:#000000;color:#FFFFFF; padding:0.2em; font:11pt Arial Narrow,Arial,Sans Serif;font-weight:bold">Links</DIV>
  125.  
  126.     <script type="text/javascript"><!--
  127. google_ad_client = "pub-8804497158739431";
  128. google_ad_width = 160;
  129. google_ad_height = 600;
  130. google_ad_format = "160x600_as";
  131. google_ad_type = "text_image";
  132. google_ad_channel = "";
  133. google_color_border = "FFFFFF";
  134. google_color_bg = "DFDFFF";
  135. google_color_link = "0000FF";
  136. google_color_text = "000000";
  137. google_color_url = "008000";
  138. //--></script>
  139. <script type="text/javascript"
  140.   src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
  141. </script>
  142.  
  143. </DIV>
  144. <DIV ID="idNeilMenu" STYLE="background-color:#DFDFFF; font:10pt Arial,Sans Serif; border:1px solid black; padding:0.2em">
  145.     <DIV STYLE="float:right">[ <A HREF="http://www.neilstuff.com/">NeilStuff Home</A> ]</DIV>
  146.  
  147.     <SCRIPT LANGUAGE="JavaScript"><!--
  148.  
  149.         document.write("[ <A HREF=\"" + location.href +
  150.             (location.href.indexOf("?") >= 0 ? "&" : "?") +
  151.         "pf=1\">printer-friendly</A> ]");
  152.  
  153.     // --></SCRIPT>
  154.  
  155. </DIV>
  156. <SCRIPT LANGUAGE="JavaScript"><!--
  157.  
  158.     // printer-friendly version
  159.     if (location.href.match(/[&?]pf=1[&]?$/))
  160.     {
  161.         var neilad = document.getElementById("idNeilAd");
  162.         neilad.style.visibility = "hidden";
  163.         neilad.style.position = "absolute";
  164.         var neilmenu = document.getElementById("idNeilMenu");
  165.         neilmenu.style.visibility = "hidden";
  166.         neilmenu.style.position = "absolute";
  167.     }
  168.  
  169. // --></SCRIPT><!--[@end@ header]-->
  170.  
  171. <font face="Verdana">
  172.  
  173. <h3>Bad Link!  <a href="<%= ToUrl %>">Click here</a> to go to <%= Title %>.</h3>
  174.  
  175. <p>I apologize, but you've followed a bad link.
  176. <% if (Known) { %>
  177.     I think you meant to go to
  178.     <a href="<%= ToUrl %>"><%= Title %></a><%= Note %> which is actually located at
  179.     <a href="<%= ToUrl %>"><%= ToUrl %></a>.
  180. <% } else { %>
  181.     I'm not sure where you were supposed to be taken, but try the
  182.     <a href="http://www.neilstuff.com">home page of this site</a>
  183.     for a table of contents.  Please
  184.     <a href="mailto:webmaster@neilstuff.com">email me</a>
  185.     if you have trouble finding what you're looking for.
  186. <% } %>
  187. </p>
  188.  
  189. <p>I encourage you to tell the referring site their link is incorrect, and to
  190. update it.  In the future, a link to a folder or HTML file is most timeless.
  191. Yes, I know this is my fault for ever having horrible URL's like
  192. <code>http://<%= Request.ServerVariables("SERVER_NAME") %><%= Request.ServerVariables("SCRIPT_NAME") %>?<%= Request.ServerVariables("QUERY_STRING") %></code>,
  193. but forgive my lapse in judgement;
  194. I was young and reckless.</p>
  195.  
  196. <p>Thanks!  -- NeilO</p>
  197.  
  198. </font>
  199.  
  200. <!--[@beg@ footer]--><!-- Start Tracksy Code -->
  201. <script type="text/javascript" src="http://tracksy.com/stats-js.cgi?host=t;user=neilo;site=01"></script>
  202. <noscript>
  203. <a href="http://tracksy.com/"><img src="http://tracksy.com/stats-image.cgi?host=t;user=neilo;site=01" alt="Tracksy Web Stats" height="1" width="1" border="0" /></a>
  204. </noscript>
  205. <!-- End Tracksy Code --><!--[@end@ footer]-->
  206. </body>
  207. </html>
  208.