Loading ...
Sorry, an error occurred while loading the content.

502 error on old site i'm updating, why?

Expand Messages
  • allphotobuzz
    Hi everyone, I m trying to get this page s form to give me results and am using the previous results page that worked before I changed the sites template. For
    Message 1 of 2 , Oct 11, 2010
      Hi everyone,

      I'm trying to get this page's form to give me results and am using the previous
      results page that worked before I changed the sites template. For some reason
      it gives me a "502 error" and I have no idea why. Anyone have any tips on this,
      or know of a form builder that I could get that will work to re-create this?

      Here's the code for the .pl results page. Thank you for your help!

      # !e:/usr/bin/perl
      # osdealers.pl

      # Local vs Remote server
      $localserv = 0 ; #set to 0 for real web server

      sub User_Data {
      local (%user_data, $user_string, $name_value_pair,
      @name_value_pairs, $name, $value);

      # If the data was sent via POST, then it is available
      # from standard input. Otherwise, the data is in the
      # QUERY_STRING environment variable.
      if ($ENV{"REQUEST_METHOD"} eq "POST") {
      else {
      $user_string = $ENV{"QUERY_STRING"};

      # This line changes the + signs to spaces.
      $user_string =~ s/\+/ /g;

      # This line places each name/value pair as a separate
      # element in the name_value_pairs array.
      @name_value_pairs = split(/&/, $user_string);

      # This code loops over each element in the name_value_pairs
      # array, splits it on the = sign, and places the value
      # into the user_data associative array with the name as the
      # key.
      foreach $name_value_pair (@name_value_pairs) {
      ($name, $value) = split(/=/, $name_value_pair);

      # These two lines decode the values from any URL
      # hexadecimal encoding. The first section searches for a
      # hexadecimal number and the second part converts the
      # hex number to decimal and returns the character
      # equivalent.
      # $name =~s/%([a-fA-Fÿ-9][a-fA-Fÿ-9])/pack("C",hex($1))/ge;
      # $value =~s/%([a-fA-Fÿ-9][a-fA-Fÿ-9])/pack("C",hex($1))/ge;

      $value = uc $value;

      # If the name/value pair has already been given a value,
      # as in the case of multiple items being selected, then
      # separate the items with a " : ".
      if (defined($user_data{$name})) {
      $user_data{$name} .= " : " . $value;
      else {
      $user_data{$name} = $value;
      return %user_data;

      if ($localserv) {
      || die "Can't open local us dealer file: $!\n";
      else {
      # old IP:
      || die "Can't open us dealer file: $!\n";

      @lines = <DFILE>;
      close(DFILE) || die "Can't close dealer file: $!\n";;

      %parmdata = &User_Data();
      $state = substr($parmdata{"state"}, 0, 2);

      if (!$localserv) {
      print "HTTP/1.0 200 OK\n";

      print "Content-type: text/html\n\n";
      print <<'__EOT__';

      <html><!-- InstanceBegin template="/Templates/lumiquest2008.dwt"
      codeOutsideHTMLIsLocked="false" -->
      <!-- InstanceBeginEditable name="doctitle" -->
      <title>LumiQuest® Photographic Accessories | LumiQuest Photographic
      Accessories | LumiQuest Dealers</title>
      <!-- InstanceEndEditable --><meta http-equiv="Content-Type" content="text/html;
      <!-- ImageReady Preload Script (lumiquest2004.psd) -->
      <script type="text/javascript">

      function newImage(arg) {
      if (document.images) {
      rslt = new Image();
      rslt.src = arg;
      return rslt;

      function changeImages() {
      if (document.images && (preloadFlag == true)) {
      for (var i=0; i<changeImages.arguments.length; i+=2) {
      document[changeImages.arguments[i]].src = changeImages.arguments[i+1];

      var preloadFlag = false;
      function preloadImages() {
      if (document.images) {
      button_products_over = newImage("images/button-products-over.gif");
      button_reviews_over = newImage("images/button-reviews-over.gif");
      button_purchase_over = newImage("images/button-purchase-over.gif");
      button_guide_over = newImage("images/button-guide-over.gif");
      button_faq_over = newImage("images/button-faq-over.gif");
      button_contact_over = newImage("images/button-contact-over.gif");
      preloadFlag = true;

      // -->

      function MM_preloadImages() { //v3.0
      var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
      var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length;
      if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
      function MM_swapImgRestore() { //v3.0
      var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)

      function MM_findObj(n, d) { //v4.01
      var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length)
      d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
      if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++)
      if(!x && d.getElementById) x=d.getElementById(n); return x;

      function MM_swapImage() { //v3.0
      var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array;
      if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc)
      x.oSrc=x.src; x.src=a[i+2];}
      <!-- End Preload Script -->
      <!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->
      <script src="http://www.lumiquest.com/Scripts/AC_RunActiveContent.js"
      <link href="../LQ2008.css" rel="stylesheet" type="text/css">
      <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"
      <!-- ImageReady Slices (lumiquest2004.psd) -->
      <div id="Container">
      <div id="RightSidebar"><!-- BEGIN: Constant Contact Basic Opt-in Email List
      Form -->
      <div align="center">
      <table border="0" cellspacing="0" cellpadding="3" bgcolor="#000000"
      style="border:2px solid #5810B2;">
      <td align="center" style="font-weight: bold; font-family:Arial; font-size:12px;
      color:#FFFFFF;">Join Our Mailing List</td>
      <td align="center" style="border-top:2px solid #5810B2">
      <form name="ccoptin" action="http://visitor.constantcontact.com/d.jsp"
      target="_blank" method="post" style="margin-bottom:2;">
      <input type="hidden" name="m" value="1102579698751">
      <input type="hidden" name="p" value="oi">
      <font style="font-weight: normal; font-family:Arial; font-size:12px;
      color:#FFFFFF;">Email:</font> <input type="text" name="ea" size="15" value=""
      style="font-size:10pt; border:1px solid #999999;">
      <input type="submit" name="go" value="Go" class="submit"
      style="font-family:Verdana,Geneva,Arial,Helvetica,sans-serif; font-size:10pt;">
      <!-- END: Constant Contact Basic Opt-in Email List Form -->
      <!-- BEGIN: SafeSubscribe -->
      <div align="center" style="padding-top:5px;"></div>
      <!-- END: SafeSubscribe -->

      <!-- BEGIN: Email Marketing you can trust -->
      <!-- END: Email Marketing you can trust -->
      <table id="Table_01" width="800" height="601" border="0" cellpadding="0"
      <td colspan="3">
      <a href="../index.htm"><img src="../images/lumiquest-logo-2008.gif"
      alt="LumiQuest" width="247" height="81" border="0"></a></td>
      <td colspan="9"><table id="Animation" width="553" height="81" border="0"
      cellpadding="0" cellspacing="0">
      <td rowspan="3"><img src="../images/top-stripes-2008-----.gif"
      width="196" height="81" alt=""></td>
      <td rowspan="3"><img src="../images/lumiquest2008_03.gif" width="12"
      height="81" alt=""></td>
      <td><img src="../images/top-stripes-2008------05.gif" width="318"
      height="13" alt=""></td>
      <td rowspan="3"><img src="../images/lumiquest2008_05.gif" width="12"
      height="81" alt=""></td>
      <td rowspan="3"><img src="../images/top-stripes-2008------07.gif"
      width="15" height="81" alt=""></td>
      <td width="318" height="53" bgcolor="#000000"><script
      hplayer','movie','../billboard' ); //end AC code
      </script><noscript><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
      rsion=6,0,0,0" width="318" height="53" id="billboard" align="middle">
      <param name="allowScriptAccess" value="sameDomain" />
      <param name="movie" value="../billboard.swf" />
      <param name="quality" value="high" />
      <param name="bgcolor" value="#000000" />
      <embed src="../billboard.swf" quality="high" bgcolor="#000000" width="318"
      height="53" name="billboard" align="middle" allowScriptAccess="sameDomain"
      pluginspage="http://www.macromedia.com/go/getflashplayer" />
      <td><img src="../images/top-stripes-2008------08.gif" width="318"
      height="15" alt=""></td>
      </table> </td>
      <td height="21" colspan="12"><table id="PurpleNav" width="800" height="21"
      border="0" cellpadding="0" cellspacing="0">
      <td><a href="http://www.lumiquest.com"><img
      src="../images/nav-home.gif" alt="LumiQuest.com" width="133" height="21"
      border="0" id="Image1"
      <td><a href="../faq.htm"> <img src="../images/nav-faq.gif" alt="FAQ"
      name="nav_faq" width="134" height="21" border="0"
      <td><a href="../askquest/index.htm"> <img src="../images/nav-blog.gif"
      alt="Ask Quest" name="nav_blog" width="133" height="21" border="0"
      <td><a href="../contact.htm"> <img src="../images/nav-contact.gif"
      alt="Contact" name="nav_contact" width="133" height="21" border="0"
      <td><a href="../reviews.htm"> <img src="../images/nav-reviews.gif"
      alt="Reviews" name="nav_reviews" width="134" height="21" border="0"
      <td><a href="../dealers.htm"> <img src="../images/nav-dealer.gif"
      alt="Find a Dealer" name="nav_dealer" width="133" height="21" border="0"
      <td width="144" rowspan="2" valign="top" id="leftnavtop"><script
      version=9,0,28,0','width','144','height','59','title','Why LumiQuest? and Do I
      need to Stick Velcro to my
      '#000000','movie','../why-lumiquest' ); //end AC code
      </script><noscript><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
      rsion=9,0,28,0" width="144" height="59" title="Why LumiQuest? and Do I need to
      Stick Velcro to my Flash?">
      <param name="movie" value="../why-lumiquest.swf">
      <param name="quality" value="high"><param name="BGCOLOR" value="#000000">
      <embed src="../why-lumiquest.swf" width="144" height="59" quality="high"
      n=ShockwaveFlash" type="application/x-shockwave-flash"
      <div id="Nav">
      <li><a href="../products.htm">LumiQuest Products</a></li>
      <li><a href="../links.htm">Who Uses LumiQuest?</a></li>
      <li><a href="../how-light-modifiers-work.htm">How Light Modifiers
      <li><a href="../compare.htm">Comparison Photos</a></li>
      <li><a href="../compatibility.htm">Compatibility Guide</a></li>
      <li><a href="../new.htm">New & Special Interest</a></li>
      <li><a href="../sale.htm">Super<br>
      Seconds Sale</a></li>
      <li><a href="../education.htm">Education Program</a></li>
      <li><a href="../media/index.html">Media<br>
      </div> <table width="108" border="0" cellspacing="0" cellpadding="0">
      <td width="6" valign="top"> </td>
      <td width="101" valign="middle" class="LeftNavLinks">
      <!-- Google CSE Search Box Begins -->
      <form action="http://www.lumiquest.com/searchresults.htm"
      <input type="hidden" name="cx"
      value="010400207748047414941:13lx_8gz1r0" />
      <input type="hidden" name="cof" value="FORID:11" />
      <input type="text" name="q" size="11" />
      <input type="submit" name="sa" value="Search" />
      <script type="text/javascript"
      <!-- Google CSE Search Box Ends --></td>
      <td height="59" colspan="11" id="mainHeadline"> <h1><!--
      InstanceBeginEditable name="Title" -->  <!-- InstanceEndEditable
      <td height="439" colspan="11" align="left" valign="top" id="content"><!--
      InstanceBeginEditable name="ContentArea" --> 

      print "<H2>LumiQuest Dealers in $state</H2><BR><BR>\n";
      print "<TABLE>\n";


      foreach $line ( @lines ) {
      ($st, $city, $zip, $name, $phone) = split(/\t/, $line);
      if ( $st lt $state) {
      elsif ( $st eq $state ) {
      print "<TR VALIGN=TOP>";
      print "<TD>";
      print "<B>$name</B>\n<BR>";
      print "$city, ";
      print "$st ";
      print "$zip";
      print "</TD>\n";
      print "<TD>";
      print "$phone";
      print "</TD>";
      print "</TR>\n";
      else {
      last ;
      if ( $cnt == 0 ) {
      print "<TR>";
      print "<TD>";
      print "No Dealers in $state.";
      print "</TD>";
      print "</TR>";
      print "</TABLE>\n";

      <!-- InstanceEndEditable --></td>
      <img src="../images/spacer.gif" width="144" height="1" alt=""></td>
      <td width="12">
      <img src="../images/spacer.gif" width="12" height="1" alt=""></td>
      <td width="91">
      <img src="../images/spacer.gif" width="91" height="1" alt=""></td>
      <td width="12">
      <img src="../images/spacer.gif" width="12" height="1" alt=""></td>
      <td width="103">
      <img src="../images/spacer.gif" width="103" height="1" alt=""></td>
      <td width="103">
      <img src="../images/spacer.gif" width="103" height="1" alt=""></td>
      <td width="103">
      <img src="../images/spacer.gif" width="103" height="1" alt=""></td>
      <td width="20">
      <img src="../images/spacer.gif" width="20" height="1" alt=""></td>
      <td width="83">
      <img src="../images/spacer.gif" width="83" height="1" alt=""></td>
      <td width="102">
      <img src="../images/spacer.gif" width="102" height="1" alt=""></td>
      <td width="1">
      <img src="../images/spacer.gif" width="1" height="1" alt=""></td>
      <td width="26">
      <img src="../images/spacer.gif" width="26" height="1" alt=""></td>
      <table width="950" border="0" cellspacing="0" cellpadding="0">
      <td width="100%" height="2"><img src="../images/spacer_blue.gif"
      width="100%" height="2"></td>
      <td height="75" align="center" class="mainBlack">
      <span class="main"><a href="../index.htm">HOME</a> <strong>|</strong>
      <a href="../products.htm">PRODUCTS</a> <strong>|</strong> <a
      href="/faq.htm">FAQ</a> <strong>|</strong> <a href="../askquest/index.htm">ASK
      QUEST</a> <strong><strong>|</strong> <a
      href="/contact.htm">CONTACT</a> |</strong> <a href="../reviews.htm">REVIEWS</a>
      <strong> |</strong> <a href="../dealers.htm">FIND
      © 2009 LumiQuest</span></p>
      <!-- End ImageReady Slices -->
      <script type="text/javascript">
      var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." :
      document.write(unescape("%3Cscript src='" + gaJsHost +
      "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
      <script type="text/javascript">
      var pageTracker = _gat._getTracker("UA-4172168-1");
      <!-- InstanceEnd --></html>
    • merlyn@stonehenge.com
      ... allphotobuzz I m trying to get this page s form to give me results and allphotobuzz am using the previous results page that worked before I allphotobuzz
      Message 2 of 2 , Oct 11, 2010
        >>>>> "allphotobuzz" == allphotobuzz <allphotobuzz@...> writes:

        allphotobuzz> I'm trying to get this page's form to give me results and
        allphotobuzz> am using the previous results page that worked before I
        allphotobuzz> changed the sites template. For some reason it gives me a
        allphotobuzz> "502 error" and I have no idea why. Anyone have any tips
        allphotobuzz> on this, or know of a form builder that I could get that
        allphotobuzz> will work to re-create this?

        First, you should at least be using CGI.pm, at a minimum. Hand-cranked
        CGI env parsers went the way of the dinosaur about the same time as Matt
        Wright's Script Archive was declared bad form.


        * The official one is at beginners@..., with instructions on how to
        * join at http://lists.perl.org/list/beginners.html.
        * You'll get far better response there, not to say you won't get *any* here.

        And there's even a beginners-cgi@... list as well, at


        Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
        <merlyn@...> <URL:http://www.stonehenge.com/merlyn/>
        Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
        See http://methodsandmessages.posterous.com/ for Smalltalk discussion
      Your message has been successfully submitted and would be delivered to recipients shortly.