PDA

View Full Version : Header Error... What it means?


helLO
04-17-2003, 04:37 PM
What does this error mean? How can i solve this error? What cause this error to appear?

Response object error 'ASP 0156 : 80004005'

Header Error

test.asp, line 8

The HTTP headers are already written to the client browser. Any HTTP header modifications must be made before writing page content.

raf
04-17-2003, 05:35 PM
My guess is you're trying to write a cookie or something after the header in your code.
(Cookies are sent with the header) But if you don't post the code, guessing is all we can do;)

helLO
04-17-2003, 05:51 PM
It is a normal logincheck page... with check of password and username...

userA = Request.form("username")
pasA = Request.form("password")
Response.cookies("Pro")("Name")=Request.form("username")

the funny part is that it can work at another computer... But just not this computer... Y is it so?

raf
04-17-2003, 05:58 PM
Response.cookies("Pro")("Name")=Request.form("username")

This line should come before any html-tag or before the first response.write.

Don't know why it works on another machine. Possible because no cookie was sent there.

helLO
04-17-2003, 06:28 PM
It is the 1st response.write statement of the page...

I tried putting it to the top... But it's appear the same error...

whammy
04-17-2003, 11:47 PM
Can you post your code? Usually this error comes from trying to process HTML before you're done with ASP...

You can use this at the top of the page:

<% Response.Buffer = True %>

But, it's probably better to figure out what's wrong with your coding first.

By the way, I have a login/registration script that will show you how to do this stuff here:

http://www.solidscripts.com/downloads/register.zip

helLO
04-18-2003, 02:15 PM
It works... But what does that code mean? --><% Response.Buffer = True %>

Before i use this code --><% Response.Buffer = True %>, I was able to run the logincheck... but not in this computer... Why is that so?

raf
04-18-2003, 02:31 PM
response.buffer = True means that the script will be processed completely (or until the parser encounters a response.flush )before any output is sent to the browser.

Before i use this code --><% Response.Buffer = True %>, I was able to run the logincheck... but not in this computer... Why is that so?

We need to see your code before we can help you with that.

helLO
04-18-2003, 02:55 PM
<%@ language=VBScript%>
<% Response.Buffer = True %>'without this, it won't work...
<html>
<body>
<center><font size=3>
<%DIM connectn
DIM records
DIM pasA,userA,staff

userA = Request.form("username")

pasA = Request.form("password")

Response.cookies("Pro")("Name")=Request.form("username")

Set connectn = Server.CreateObject("ADODB.Connection")
Set records = Server.CreateObject("ADODB.Recordset")

connectn.Open "test"
records.Open "SELECT * FROM UserProfile WHERE Username='"&userA&"' ",connectn


if records.EOF then

response.write("Not a registered user!")


elseif (strcomp(trim(pasA),trim(records("password")))=0) then
session("secure")=1
response.redirect "main_page.asp"

else

response.write("Password incorrect!<br/>")

end if

records.close
connectn.close
set records=nothing
set connectn=nothing
%>

</center>
</font>
</body>
</html>