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"> </td>
</tr>
<tr>
<td colspan="6" align="center"> </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" > </td>
<td width="1" rowspan="4" align="center" class="style17" > </td>
<td width="158" height="32" align="center" class="style17" > </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" > </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" > </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" > </td>
<td height="33" align="center" ><div align="left"></div></td>
<td align="center"><input name="submit" type="submit" onclick="return verify()" value=" Log In " /></td>
</tr>
<tr >
<td align="center" > </td>
<td align="center" > </td>
<td align="center" class="style17" > </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 "lost password" in the subject line of your email.</div></td>
</tr>
</table>
<br>
<% end if%>
</form>
</p>
</div>
</div>
</body>
</html>