Script generates 500 Server Error

Author Message
mmcnab

  • Total Posts : 3
  • Scores: 0
  • Reward points : 0
  • Joined: 12/30/2008
  • Status: offline
Script generates 500 Server Error Wednesday, March 25, 2009 8:10 AM (permalink)
0
Following is the code from a loin page for my site.  The SQL query executes perfectly in Mgt Studio but something is throwing a 500 Server error.  Any help would be greatly appreciated.
 
<%@ EnableSessionState=true %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<%
response.cookies("username")="authenticated"
response.cookies("password")="authenticated"
response.cookies("FranklinProof").Expires = date + 10
%>

<head>
 <title>Franklin Press Direct Mail and Data Management</title>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
 <meta name="keywords" content="" />
 <meta name="description" content="direct mail advertising, mailing service, direct marketing, mail service, full color digital printing, marketing services, postal services,direct marketing mail, direct mail printer,direct mail printing,digital print,
direct mail, direct mail advertising services,  variable data digital printing, data processing services, direct mail companies,
mailing services, variable data printing, direct mail printers, color digital printing, database marketing, offset and digital printing, digital printing, marketing communications,data management" /> 
 <meta http-equiv="imagetoolbar" content="no" />
 <link href="bl-stylesheet.css" rel="stylesheet" type="text/css" />
    <style type="application/xhtml+xml">
    </style>
    <style type="text/css">
<!--
#Layer1 {
 position:absolute;
 width:200px;
 height:115px;
 z-index:1;
 left: 143px;
 top: 153px;
}
#Layer2 {
 position:absolute;
 width:493px;
 height:26px;
 z-index:2;
 left: 373px;
 top: 220px;
}
body {
 background-color: #CCCCCC;
}
.style3 {
 color: #006633;
 font-weight: bold;
}
.style4 {
 color: #FFFFFF;
 font-weight: bold;
}
.style5 {color: #006633}
-->
    </style>
</head>
<body>
 <div id="container">
   <div id="header"><img src="Franklin-press-color-logo-w.gif" alt="logo" width="180" height="68"/> </div>
  <ul id="nav">
    <li><a href="index.asp" title="Home">Home</a></li>
    <li><a href="services.html" title="Services">Services</a></li>
    <li><a href="contact.html" title="Contacts">Contacts</a></li>
    <li><a href="about.html" title="About">About</a></li>
    <li><a href="security.html" title="Security">Security</a></li>
                <li><a href="green.html" title="Environment">Environment</a></li>
  </ul>
  
   <div>
<p class="style3"><!-- #include file="client/database_connection.asp" -->
<%
if not isempty(request("submit")) then
  'sql="select Folder_id,ContactName,username,password,email from [view Contact] where username='"&trim(request.Form("username"))&"' and password ='"&trim(request.Form("password"))&"'"
 
  sql="select Folder_id,contactname,username,[view contact].[password],[view contact].email,parties.email as salesemail from [view contact] inner join [view customers] on [view contact].[folder_id] = [view customers].[customer code] inner join users on users.first_name +' '+users.last_name = salespersonname inner join parties on parties.party_id = users.party_id where username='"&trim(request.Form("username"))&"' and password ='"&trim(request.Form("password"))&"'"

  if rs.state=1 then rs.close
   rs.open sql,conn,3,2
  
   if rs.recordcount<>0 then
     session("Folder_id") = rs("Folder_id")
     session("ContactName") = rs("ContactName")
  session("username") = rs("username")
  session("password") = rs("password")
  session("salesemail") = rs("salesemail")
  session("email") = rs("email")
     if rs("Folder_id")<>"" then
  response.Redirect("client/landing.asp")
  end if
 else
   var_comment=" User Name or Password Mismatch - Please go back and try again."
 end if
end if
%>
<html>
<head>
<script language="JavaScript">
function verify()
{
 
  if (document.login_form.username.value=="")
  {
    alert("Please Enter your loginname");
 document.login_form.username.focus();
 return false;
  }
    if (document.login_form.password.value=="")
  {
    alert("Please enter your password");
 document.login_form.password.focus();
 return false;
  } }
</script>
<style type="text/css">
<!--
.style1 {font-family: Verdana, Arial, Helvetica, sans-serif}
.style5 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small; }
#Layer1 {
 position:absolute;
 width:666px;
 height:824px;
 z-index:1;
 left: 410px;
 top: 196px;
 vertical-align: text-top;
 word-spacing: normal;
 list-style-image: url(../img07.gif);
}
.style17 { font-family: Verdana, Arial, Helvetica, sans-serif;
 font-size: x-small;
 color: #1E5E0A;
 font-weight: bold;
}
.style26 {
 font-family: Arial, Helvetica, sans-serif;
 white-space: normal;
}
.style27 {
 color: #000000;
 font-family: Arial, Helvetica, sans-serif;
}
body {
 margin-left: 50px;
}
.style29 {color: #042EB9}
.style30 {color: #042EB9; font-family: Arial, Helvetica, sans-serif; font-weight: bold; }
.style31 {font-family: Arial, Helvetica, sans-serif; font-size: x-small; }
.style32 {font-size: xx-small}
.style38 {
 font-size: small;
 font-style: italic;
 font-weight: bold;
}
.style39 {font-family: Arial, Helvetica, sans-serif}
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
     <form name="login_form" action="https://www.franklin-press.com/index.asp" method="post">
       <h3><img src="Home.gif" alt="BANNER" width="740" height="200" /></h3>
       <table width="685" height="345" border="0" align="center">
      <% if var_comment<>"" then %>
   <tr>
        <td colspan="6" align="center"><div align="left"><span class="style1">
          <%response.Write(var_comment)%>
        </span></div></td>
      </tr>
   <tr>
     <td colspan="6" align="center">&nbsp;</td>
     </tr>
   <tr>
     <td colspan="6" align="center">&nbsp;</td>
   </tr>
   <% else %>
      <tr >
        <td height="32" colspan="2" align="center" class="style17" ><h3 align="left" class="style27">Upload Files </h3></td>
        <td width="1" rowspan="5" align="center" bgcolor="#006633" class="style17" >&nbsp;</td>
        <td width="1" rowspan="4" align="center" class="style17" >&nbsp;</td>
        <td width="158" height="32" align="center" class="style17" >&nbsp;</td>
        <td width="116" height="32" align="center" class="style17" ><h3><span class="style27"><strong>Client Login</strong></span></h3></td>
      </tr>
      <tr >
        <td width="382" align="center" ><div align="left">
          <h4 align="left"><a href="Click'>https://www.franklin-press.com/upload.asp">Click Here
              <label>                </label>
             
            <strong>
              <label></label>
            </strong></a></h4>
        </div></td>
        <td width="1" align="center" >&nbsp;</td>
        <td height="32" align="center" ><div align="right"><span class="style5">User
          Name:</span></div></td>
        <td align="center"><input name="username" type="text"  size="10" value=""></td>
       
      </tr>
      <tr >
        <td rowspan="2" align="center" ><div align="left">
          <p>Franklin Press uses SSL (Secure Socket Layer) encryption to safeguard your files while uploading.</p>
          <p>If you  will be uploading files frequently, please obtain a user name and password from your sales representative or customer service representative to enable you to login and use our fast upload form as well as access our prepress proofing portal. To learn more please <a href="prepress.html">click here.</a></p>
        </div></td>
        <td align="center" >&nbsp;</td>
        <td height="33" align="center" ><div align="right"><span class="style5">Password:</span></div></td>
        <td align="center"><input name="password" type="password" size="10">        </td>
      </tr>
      <tr >
        <td align="center" >&nbsp;</td>
        <td height="33" align="center" ><div align="left"></div></td>
        <td align="center"><input name="submit" type="submit" onclick="return verify()" value="&nbsp;&nbsp;&nbsp; Log In &nbsp;&nbsp;&nbsp;" /></td>
      </tr>
      <tr >
        <td align="center" >&nbsp;</td>
        <td align="center" >&nbsp;</td>
        <td align="center" class="style17" >&nbsp;</td>
        <td height="33" colspan="2" align="center" ><div align="left">Lost password? Please <a href="click'>mailto:CSR@franklin-press.com">click here</a> and enter &quot;lost password&quot; in the subject line of your email.</div></td>
        </tr>
  </table>
    <br>
    <% end if%>
</form>
 
   </p>
      </div>
</div>
</body>
</html>

 
#1
    TNO

    • Total Posts : 2094
    • Scores: 36
    • Reward points : 0
    • Joined: 12/18/2004
    • Location: Earth
    • Status: offline
    RE: Script generates 500 Server Error Thursday, March 26, 2009 4:23 AM (permalink)
    0
    Do you get any error messages on the page beyond a 500 error? 

    If you open the page in Firefox, does it give you a better error message?
    To iterate is human, to recurse divine. -- L. Peter Deutsch
     
    #2
      mmcnab

      • Total Posts : 3
      • Scores: 0
      • Reward points : 0
      • Joined: 12/30/2008
      • Status: offline
      RE: Script generates 500 Server Error Thursday, March 26, 2009 7:53 AM (permalink)
      0
      Yes, I tried in Firefox as well as Safari and nothing beyond the 500 error.  Double checked my browser and IIS settings as well.
       
      #3
        TNO

        • Total Posts : 2094
        • Scores: 36
        • Reward points : 0
        • Joined: 12/18/2004
        • Location: Earth
        • Status: offline
        RE: Script generates 500 Server Error Thursday, March 26, 2009 11:43 AM (permalink)
        0
        I'm not seeing anything from a quick glance at the server code (issue within the include file?).
        Perhaps this will help: http://learn.iis.net/page.aspx/564/classic-asp-script-error-messages-are-no-longer-shown-in-a-web-browser-by-default/

        Beyond that, you may want to rewrite the page in a modular fashion to see what crops up as you implement the functionality piecemeal


        Unrelated problem to fix:
        You have multiple <html> and head content that should be consolidated/removed.
        http://www.visualbasicscript.com/m_58515/tm.htm
        To iterate is human, to recurse divine. -- L. Peter Deutsch
         
        #4
          jsjay9

          • Total Posts : 6
          • Scores: 0
          • Reward points : 0
          • Joined: 9/10/2009
          • Status: offline
          Re:Script generates 500 Server Error Thursday, September 10, 2009 9:57 AM (permalink)
          0
          The error seems to be in the include file; when I commented it out, there was no error. 
          <!-- #include file="client/database_connection.asp" -->

          Some browsers will give you more descriptive error messages if you change the setting:
          In Internet Explorer, {Tools} -> {Internet Options} -> {Advanced} tab -> UNcheck the "Show friendly HTTP error messages" in the BROWSING section.
           
          I hope something here helps.  :)
           
           <%@EnableSessionState=true%> 
               <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 
               <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> 
               <% 
               response.cookies("username")="authenticated" 
               response.cookies("password")="authenticated" 
               response.cookies("FranklinProof").Expires = date + 10 
               %> 
               <head> 
               <title>Franklin Press Direct Mail and Data Management</title> 
               <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> 
               <meta name="keywords" content="" /> 
               <meta name="description" content="direct mail advertising, mailing service, direct marketing, mail service, full color digital printing, marketing services, postal services,direct marketing mail, direct mail printer,direct mail printing,digital print, 
               direct mail, direct mail advertising services, variable data digital printing, data processing services, direct mail companies, 
               mailing services, variable data printing, direct mail printers, color digital printing, database marketing, offset and digital printing, digital printing, marketing communications,data management" /> 
               <meta http-equiv="imagetoolbar" content="no" /> 
               <link href="bl-stylesheet.css" rel="stylesheet" type="text/css" /> 
               <script language="JavaScript"> 
               function verify() 
               { 
               
               if (document.login_form.username.value=="") 
               { 
               alert("Please Enter your loginname"); 
               document.login_form.username.focus(); 
               return false; 
               } 
               if (document.login_form.password.value=="") 
               { 
               alert("Please enter your password"); 
               document.login_form.password.focus(); 
               return false; 
               } } 
               </script> 
               <style type="application/xhtml+xml"> 
               </style> 
               <style type="text/css"> 
               <!-- 
               #Layer1 { 
               position:absolute; 
               width:200px; 
               height:115px; 
               z-index:1; 
               left: 143px; 
               top: 153px; 
               } 
               #Layer2 { 
               position:absolute; 
               width:493px; 
               height:26px; 
               z-index:2; 
               left: 373px; 
               top: 220px; 
               } 
               body { 
               background-color: #CCCCCC; 
               } 
               .style3 { 
               color: #006633; 
               font-weight: bold; 
               } 
               .style4 { 
               color: #FFFFFF; 
               font-weight: bold; 
               } 
               .style5 {color: #006633} 
               --> 
               </style> 
               </head> 
               <body> 
               <div id="container"> 
               <div id="header"><img src="Franklin-press-color-logo-w.gif" alt="logo" width="180" height="68"/> </div> 
               <ul id="nav"> 
               <li><a href="index.asp" title="Home">Home</a></li> 
               <li><a href="services.html" title="Services">Services</a></li> 
               <li><a href="contact.html" title="Contacts">Contacts</a></li> 
               <li><a href="about.html" title="About">About</a></li> 
               <li><a href="security.html" title="Security">Security</a></li> 
               <li><a href="green.html" title="Environment">Environment</a></li> 
               </ul> 
               
               <div> 
               <p class="style3"> 
               
               <% 
               ' <!-- #include file="client/database_connection.asp" --> ' 
               if not isempty(request("submit")) then 
               'sql="select Folder_id,ContactName,username,password,email from [view Contact] where username='"&trim(request.Form("username"))&"' and password ='"&trim(request.Form("password"))&"'" ' 
               
               sql="select Folder_id,contactname,username,[view contact].[password],[view contact].email,parties.email as salesemail from [view contact] inner join [view customers] on [view contact].[folder_id] = [view customers].[customer code] inner join users on users.first_name +' '+users.last_name = salespersonname inner join parties on parties.party_id = users.party_id where username='"&trim(request.Form("username"))&"' and password ='"&trim(request.Form("password"))&"'" 
               
               if rs.state=1 then rs.close 
               rs.open sql,conn,3,2 
               
               if rs.recordcount<>0 then 
               session("Folder_id") = rs("Folder_id") 
               session("ContactName") = rs("ContactName") 
               session("username") = rs("username") 
               session("password") = rs("password") 
               session("salesemail") = rs("salesemail") 
               session("email") = rs("email") 
               if rs("Folder_id")<>"" then 
               response.Redirect("client/landing.asp") 
               end if 
               else 
               var_comment=" User Name or Password Mismatch - Please go back and try again." 
               end if 
               end if 
               %> 
               <style type="text/css"> 
               <!-- 
               .style1 {font-family: Verdana, Arial, Helvetica, sans-serif} 
               .style5 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small; } 
               #Layer1 { 
               position:absolute; 
               width:666px; 
               height:824px; 
               z-index:1; 
               left: 410px; 
               top: 196px; 
               vertical-align: text-top; 
               word-spacing: normal; 
               list-style-image: url(../img07.gif); 
               } 
               .style17 { font-family: Verdana, Arial, Helvetica, sans-serif; 
               font-size: x-small; 
               color: #1E5E0A; 
               font-weight: bold; 
               } 
               .style26 { 
               font-family: Arial, Helvetica, sans-serif; 
               white-space: normal; 
               } 
               .style27 { 
               color: #000000; 
               font-family: Arial, Helvetica, sans-serif; 
               } 
               body { 
               margin-left: 50px; 
               } 
               .style29 {color: #042EB9} 
               .style30 {color: #042EB9; font-family: Arial, Helvetica, sans-serif; font-weight: bold; } 
               .style31 {font-family: Arial, Helvetica, sans-serif; font-size: x-small; } 
               .style32 {font-size: xx-small} 
               .style38 { 
               font-size: small; 
               font-style: italic; 
               font-weight: bold; 
               } 
               .style39 {font-family: Arial, Helvetica, sans-serif} 
               --> 
               </style> 
               <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> 
               <form name="login_form" action="https://www.franklin-press.com/index.asp" method="post"> 
               <h3><img src="Home.gif" alt="BANNER" width="740" height="200" /></h3> 
               <table width="685" height="345" border="0" align="center"> 
               <% if var_comment<>"" then %> 
               <tr> 
               <td colspan="6" align="center"><div align="left"><span class="style1"> 
               <%response.Write(var_comment)%> 
               </span></div></td> 
               </tr> 
               <tr> 
               <td colspan="6" align="center">&nbsp;</td> 
               </tr> 
               <tr> 
               <td colspan="6" align="center">&nbsp;</td> 
               </tr> 
               <% else %> 
               <tr > 
               <td height="32" colspan="2" align="center" class="style17" ><h3 align="left" class="style27">Upload Files </h3></td> 
               <td width="1" rowspan="5" align="center" bgcolor="#006633" class="style17" >&nbsp;</td> 
               <td width="1" rowspan="4" align="center" class="style17" >&nbsp;</td> 
               <td width="158" height="32" align="center" class="style17" >&nbsp;</td> 
               <td width="116" height="32" align="center" class="style17" ><h3><span class="style27"><strong>Client Login</strong></span></h3></td> 
               </tr> 
               <tr > 
               <td width="382" align="center" ><div align="left"> 
               <h4 align="left"><a href="Click'>https://www.franklin-press.com/upload.asp">Click Here 
               <label> </label> 
               
               <strong> 
               <label></label> 
               </strong></a></h4> 
               </div></td> 
               <td width="1" align="center" >&nbsp;</td> 
               <td height="32" align="center" ><div align="right"><span class="style5">User 
               Name:</span></div></td> 
               <td align="center"><input name="username" type="text" size="10" value=""></td> 
               
               </tr> 
               <tr > 
               <td rowspan="2" align="center" ><div align="left"> 
               <p>Franklin Press uses SSL (Secure Socket Layer) encryption to safeguard your files while uploading.</p> 
               <p>If you will be uploading files frequently, please obtain a user name and password from your sales representative or customer service representative to enable you to login and use our fast upload form as well as access our prepress proofing portal. To learn more please <a href="prepress.html">click here.</a></p> 
               </div></td> 
               <td align="center" >&nbsp;</td> 
               <td height="33" align="center" ><div align="right"><span class="style5">Password:</span></div></td> 
               <td align="center"><input name="password" type="password" size="10"> </td> 
               </tr> 
               <tr > 
               <td align="center" >&nbsp;</td> 
               <td height="33" align="center" ><div align="left"></div></td> 
               <td align="center"><input name="submit" type="submit" onclick="return verify()" value="&nbsp;&nbsp;&nbsp; Log In &nbsp;&nbsp;&nbsp;" /></td> 
               </tr> 
               <tr > 
               <td align="center" >&nbsp;</td> 
               <td align="center" >&nbsp;</td> 
               <td align="center" class="style17" >&nbsp;</td> 
               <td height="33" colspan="2" align="center" ><div align="left">Lost password? Please <a href="click'>mailto:CSR@franklin-press.com">click here</a> and enter &quot;lost password&quot; in the subject line of your email.</div></td> 
               </tr> 
               </table> 
               <br> 
               <% end if%> 
               </form> 
               
               </p> 
               </div> 
               </div> 
               </body> 
               </html> 

          <message edited by jsjay9 on Thursday, September 10, 2009 9:58 AM>
           
          #5

            Online Bookmarks Sharing: Share/Bookmark

            Jump to:

            Current active users

            There are 0 members and 1 guests.

            Icon Legend and Permission

            • New Messages
            • No New Messages
            • Hot Topic w/ New Messages
            • Hot Topic w/o New Messages
            • Locked w/ New Messages
            • Locked w/o New Messages
            • Read Message
            • Post New Thread
            • Reply to message
            • Post New Poll
            • Submit Vote
            • Post reward post
            • Delete my own posts
            • Delete my own threads
            • Rate post

            2000-2012 ASPPlayground.NET Forum Version 3.9