Header Error question

Results 1 to 2 of 2

Thread: Header Error question

  1. #1
    Join Date
    Dec 1969

    Default Header Error question

    I am getting the following error:<BR>Response object error &#039;ASP 0156 : 80004005&#039; <BR>Header Error <BR>/wpsignin.asp, line 3 <BR>The HTTP headers are already written to the client browser. Any HTTP header modifications must be made before writing page content. <BR><BR>I have added the Response.Buffer = True and still get this error.<BR>Anyother ideas where this may be happening?<BR><BR>Here is my code:<BR>&#060;%Option Explicit%&#062;<BR>&#060;!--#include file = "wpfunctions.asp"--&#062;<BR>&#060;% Response.Buffer = True %&#062;<BR>&#060;%<BR>&#039;Read in the form field variables<BR>Dim strUsername, strPassword<BR>strUsername = Request.Form("wpusername")<BR>strPassword = UCase(Request.Form("wppassword"))<BR><BR>&#039;Dim ension database variables<BR>Dim adoCon &#039;Holds the Database Connection Object<BR>Dim rsWP &#039;Holds the recordset for the records in the database<BR>Dim strSQL &#039;Holds the SQL query to query the database<BR>Dim intFound &#039;Holds 1 for found and 0 for not found.<BR>Dim strTeam &#039;Holds favorite team user selected.<BR><BR>&#039;Check if strUsername, strPassword are not blank.<BR>If strUsername = "" or strPassword = "" Then<BR> &#039;Try again<BR> Response.Redirect "wperror.asp?error=1&seconds=10"<BR> Response.End<BR>End if<BR><BR>&#039;Create an ADO connection object<BR>Set adoCon = Server.CreateObject("ADODB.Connection")<BR><BR>&#0 39;Set an active connection to the Connection object using a DSN-less connection<BR>adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("/db/aspWP.mdb")<BR><BR>&#039;Create an ADO recordset object<BR>Set rsWP = Server.CreateObject("ADODB.Recordset") <BR> <BR>&#039;Initialise the strSQL variable with an SQL statement to query the database<BR>strSQL = "SELECT UserInfo.Username, UserInfo.Password, UserInfo.Team, UserInfo.NFL " _<BR> & "FROM UserInfo " _<BR> & "WHERE UserInfo.Username = &#039;" & strUserName & "&#039;;"<BR><BR>&#039;Set the cursor type we are using so we can navigate through the recordset<BR>rsWP.CursorType = 2<BR><BR>&#039;Set the lock type so that the record is locked by ADO when it is updated<BR>rsWP.LockType = 3<BR><BR>&#039;Open the recordset with the SQL query <BR>rsWP.Open strSQL, adoCon<BR><BR>If rsWP.EOF = True and rsWP.BOF = True Then<BR> &#039;No records found. No User found<BR> intFound = 0<BR> strTeam = "na"<BR>Else<BR> If fnDeEncrypt(rsWP.Fields("Password")) = strPassword Then<BR> &#039;Record found<BR> intFound = 1<BR> strTeam = rsWP.Fields("Team")<BR> Else<BR> intFound = 0<BR> strTeam = "na"<BR> End if<BR>End if<BR><BR>&#039;Reset server objects<BR>rsWP.Close<BR>Set rsWP = Nothing<BR>Set adoCon = Nothing<BR><BR>If intFound = 0 Then<BR> &#039;Redirect to the wpsignin.htm page<BR> Response.Redirect "wperror.asp?error=2&seconds=10"<BR> Response.End<BR>Else<BR> &#039;Redirect to the wpMain.asp page<BR> Session("wpUsername") = strUsername<BR> <BR> &#039;If Request.Cookies("wpWeeklyPicks").HasKeys Then<BR> &#039;Cookie expires at end of season. Change number to end of season.<BR> &#039; Response.Cookies("wpWeeklyPicks").Expires = Date + 7<BR> &#039; Response.Cookies("wpWeeklyPicks")("UserName") = strUsername<BR> &#039; &#039;Response.Cookies("wpWeeklyPicks")("Team") = strTeam<BR> &#039;Else<BR> &#039; Response.Cookies("wpWeeklyPicks").Expires = Date + 7<BR> &#039; Response.Cookies("wpWeeklyPicks")("UserName") = strUsername<BR> &#039; &#039;Response.Cookies("wpWeeklyPicks")("Team") = strTeam<BR> &#039;End if<BR> Response.Redirect "wpMain.asp"<BR>End if<BR><BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default ASPFAQs, category The Nature of Things

    The link to the ASPFAQs is at the top right corner of most every page on this site, including the one you are reading right now.<BR><BR>If you didn&#039;t know to look in the category noted above, a search for "headers" would find the answer, too.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts