Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What does this ERROR mean???? 4

Status
Not open for further replies.

TonyU

Technical User
Feb 14, 2001
1,317
0
0
US
Response object error 'ASP 0156 : 80004005'

Header Error

/site/verify.asp, line 27

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


>>> Line 27 Response.redirect defaultsite
Tony
:)
 
This error happens because the Web server has set the client browser using an HTTP header and then tries to reset it using another HTTP header, for example, when an HTTP header sets the browser to content-type=text/html and a redirection is issued after this. An example of this is when an ASP page is processed that contains HTML tags or any other server-side scripts before a Response.Redirect statement.

MORE:

br
Gerard
(-:
 
Thank you very much bud Tony
:)
 
Make sure the first executable line in your asp page is:
response.buffer = true
 
Yes, the link hat foxbox gave me provided me that informatin bro tyvm also.

Thanks fellas Tony
:)
 
THIS IS NOT WORKING
Can you figure out why??
When a name in the database is not found, the page produces this error and it should not.
************************************
ERROR
Response object error 'ASP 0158 : 80004005'

Missing URL

/SITE/verify.asp, line 29

A URL is required.
************************************



<% @LANGUAGE = &quot;VBScript&quot; %>
<% Response.Buffer = True %>
<HTML>
<HEAD>
</HEAD>
<BODY>
<%
sql=&quot;select * from logins&quot;

Dim RSlogin
set RSlogin=server.createobject(&quot;adodb.recordset&quot;)
RSlogin.open sql, &quot;dsn=mydb1&quot;

if not RSlogin is nothing then
RSlogin.movefirst()
exitcondition = false
while not RSlogin.eof and not exitcondition
if RSlogin(&quot;UserName&quot;) = Request.Form(&quot;username&quot;) then
if RSlogin(&quot;PassWord&quot;) = Request.Form(&quot;password&quot;) then
defaultsite = RSlogin(&quot;DefaultSite&quot;)
Session(&quot;userid&quot;) = RSlogin(&quot;ID&quot;)
exitcondition =true
end if
end if
RSlogin.MoveNext
wend
end if
if Session(&quot;userid&quot;) <> &quot;&quot; and not IsEmpty(Session(&quot;userid&quot;)) then
response.redirect defaultsite
else

Response.write &quot;<b><font color=&quot;&quot;red&quot;&quot;>Inccorect Login Please try again</font></b>&quot;

Response.flush
end if
%>
</BODY>
</HTML>
<% Response.End %>






Tony
:)
 
I'm still a newbie, but I think the problem is (in red):

<% @LANGUAGE = &quot;VBScript&quot; %>
<% Response.Buffer = True %>
<HTML>
<HEAD>
</HEAD>
<BODY>
<%
sql=&quot;select * from logins&quot;

Dim RSlogin
set RSlogin=server.createobject(&quot;adodb.recordset&quot;)
RSlogin.open sql, &quot;dsn=mydb1&quot;

if not RSlogin is nothing then
RSlogin.movefirst()
exitcondition = false
while not RSlogin.eof and not exitcondition
if RSlogin(&quot;UserName&quot;) = Request.Form(&quot;username&quot;) then
if RSlogin(&quot;PassWord&quot;) = Request.Form(&quot;password&quot;) then
defaultsite = RSlogin(&quot;DefaultSite&quot;)
Session(&quot;userid&quot;) = RSlogin(&quot;ID&quot;)
exitcondition =true
end if
end if
RSlogin.MoveNext
wend
end if
if Session(&quot;userid&quot;) <> &quot;&quot; and not IsEmpty(Session(&quot;userid&quot;)) then
[red] response.redirect defaultsite

should be:
response.redirect &quot;defaultsite&quot;[/red]
else

Response.write &quot;<b><font color=&quot;&quot;red&quot;&quot;>Inccorect Login Please try again</font></b>&quot;

Response.flush
end if
%>
</BODY>
</HTML>
<% Response.End %>
 
The problem is that if there are no records, no value is being assigned to 'defaultSite', and so when you call response.redirect, you're giving it an empty variable -- hence the URL required error message.

Try assigning it a default value before you enter all of your if blocks, and then if it finds a record, it will assign a proper value, and if not, it will just go to the default value.
penny.gif
penny.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top