Web Wiz - Green Windows Web Hosting - Celebrating 25 Years!

  New Posts New Posts RSS Feed - Hide asp or database error
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Hide asp or database error

 Post Reply Post Reply
Author
likefuture View Drop Down
Newbie
Newbie


Joined: 27 September 2005
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote likefuture Quote  Post ReplyReply Direct Link To This Post Topic: Hide asp or database error
    Posted: 21 November 2005 at 11:31am

Hi all. I'm trying to find a way to hide the error information shown on browsers, which caused by asp code. I think it will make the forum more security. I added <% On Error Resume next %> into header.asp, but it seems don't work. Do you have any idea about it? thanks!

Back to Top
JJLatWebWiz View Drop Down
Groupie
Groupie
Avatar

Joined: 02 March 2005
Location: United States
Status: Offline
Points: 136
Post Options Post Options   Thanks (0) Thanks(0)   Quote JJLatWebWiz Quote  Post ReplyReply Direct Link To This Post Posted: 21 November 2005 at 6:28pm
The On Error Resume Next isn't all-inclusive. If the main program is in Resume Next mode and the main program calls a subroutine that does not have its own On Error Resume Next, the subroutine could cause an error that halts the whole program.

The most dangerous errors are the ones that expose the path of the Access database. If the Access database is stored in a folder above the WWW root and that is not accessible as a web folder, then even if the path is exposed, the database is still relatively safe.

Is there a "most frequent" error that you're seeing? If so, I wouldn't mind trying to build something that could better protect the path information for you.
p.s. I'm not affiliated with Web Wiz Guide in any way. I'm just an average Web Wiz user repaying my debt for the use of their fine forum by trying to help other Web Wiz Guide users.
Back to Top
likefuture View Drop Down
Newbie
Newbie


Joined: 27 September 2005
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote likefuture Quote  Post ReplyReply Direct Link To This Post Posted: 21 November 2005 at 7:40pm
hi, JJLatWebWiz. Thanks. I installed the version 7.96 on my own computer and my website is only in the testing stage. There is no many problems about WWF. but today, I try to move a topic to a forum which has no any topics, the error occured. and then my database name, column name and something else are all diplayed on the Browser. So I think it maybe dangerouse.
Back to Top
JJLatWebWiz View Drop Down
Groupie
Groupie
Avatar

Joined: 02 March 2005
Location: United States
Status: Offline
Points: 136
Post Options Post Options   Thanks (0) Thanks(0)   Quote JJLatWebWiz Quote  Post ReplyReply Direct Link To This Post Posted: 22 November 2005 at 10:10am
likefuture, I'll look at the code that performs that process, but it would be more useful if you would copy and paste the exact error message. The asp file name, exact line number, and error code will make it easier to build a more meaningful change.

Also, don't worry too much about hiding your forum database column name or file names. Trust me that hackers know every file and column name already. Hiding your database in a non-web folder is about all that you can do to protect your Access database.
p.s. I'm not affiliated with Web Wiz Guide in any way. I'm just an average Web Wiz user repaying my debt for the use of their fine forum by trying to help other Web Wiz Guide users.
Back to Top
likefuture View Drop Down
Newbie
Newbie


Joined: 27 September 2005
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote likefuture Quote  Post ReplyReply Direct Link To This Post Posted: 22 November 2005 at 11:11am

hi, JJLatWebWiz. The following are some information about the error:

Enviroment:
  OS: Windows 2003
  Database: SQL Server

the first step, I move a topic to a empty forum. in the second step, because there is no any topic in this forum, so I cannot choose a topic moved to and also leave the 'new subject' textbox blank, then click 'move', the error message appeared. I translated it to english as below,
 
Microsoft OLE DB Provider for SQL Server error '80040e2f'
UPDATE is violation of COLUMN FOREIGN KEY constraint 'tblThread_FK01' in database 'WWForum'£¬table 'tblTopic', column 'Topic_ID'¡£
/BBS/move_post.asp£¬line 202
 
thanks.
Back to Top
JJLatWebWiz View Drop Down
Groupie
Groupie
Avatar

Joined: 02 March 2005
Location: United States
Status: Offline
Points: 136
Post Options Post Options   Thanks (0) Thanks(0)   Quote JJLatWebWiz Quote  Post ReplyReply Direct Link To This Post Posted: 22 November 2005 at 2:46pm
First, since you're using SQL, your data is much safer compared to the Access version. And hackers definitely know the SQL tables very well just by installing WWF themselves. But, this is a very inelegant error to be presented.

I assume you do not get this error when you fill in the "new subject" text box. This appears to be a minor bug from at least 7.01 through 7.96. I don't know how it would manifest in the Access version, but I think it will produce an error at the same line number with some reference to a referential integrity.

Here's what I came up with: In "move_post.asp", you need to detect that no topic from the list was chosen and no new subject was entered. So, open "move_post.asp" and insert the red code:


'If the user is user is using a banned IP redirect to an error page
If bannedIP() Then
'Clean up
Set rsCommon = Nothing
adoCon.Close
Set adoCon = Nothing
'Redirect
Response.Redirect("insufficient_permission.asp?M=IP")
End If

If (Request.Form("topicSelect") = "") and (Trim(Request.Form("subject")) = "") then
'Clean up
Set rsCommon = Nothing
adoCon.Close
Set adoCon = Nothing
%>
<html>
<head>
<meta name="copyright" content="Copyright (C) 2001-2005 Bruce Corkhill" />
<title>Discussion Forum Move Post</title>
<%
'***** START WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ******
Response.Write("<!--//" & _
vbCrLf & "/* *******************************************************" & _
vbCrLf & "Application: Web Wiz Forums ver. " & strVersion & "" & _
vbCrLf & "Author: Bruce Corkhill" & _
vbCrLf & "Info: http://www.webwizforums.com" & _
vbCrLf & "Available FREE: http://www.webwizforums.com" & _
vbCrLf & "Copyright: Bruce Corkhill ©2001-2005. All rights reserved" & _
vbCrLf & "******************************************************* */" & _
vbCrLf & "//-->" & vbCrLf & vbCrLf)
'***** END WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ******
%>
<!--#include file="includes/skin_file.asp" -->
</head>
<body bgcolor="<% = strBgColour %>" text="<% = strTextColour %>" background="<% = strBgImage %>" marginheight="0" marginwidth="0" topmargin="0" leftmargin="0" OnLoad="self.focus();">
<div align="center" class="heading">Invalid Topic</div>
<div align="center" class="text"><br />You must choose a topic from the list or enter a new topic.<br /><br />
Click here to <a href="move_post_form.asp?PID=<%=Request.Form("PID")%>">return to the initial Topic Move form.</a>
</div>
</body>
</html>
<%
Else

'Read in the post ID
lngPostID = CLng(Request.Form("PID"))



and at the end


%>
<html>
<head>
<script language="JavaScript">
window.opener.location.href = "forum_posts.asp?TID=<% = lngTopicID %>"
window.close();
</script>
</head>
</html>
<%
End If
%>



Insert only the red code. You should find the black code already in the file.

With that change, a moderator and adminstrator should no longer be presented with the unaccounted for error. However, only admins and moderators would ever see that error. Presumably, such users are people you trust, so you have little to fear from an error in that particular process. A more complete bug fix would include a javascript in "move_post_form_to.asp" that checks that either a topic is selected or a non-blank subject is entered. I'll leave that to - boRg - for now.

(hopefully the forum filters don't make these suggested changes unintelligible)
p.s. I'm not affiliated with Web Wiz Guide in any way. I'm just an average Web Wiz user repaying my debt for the use of their fine forum by trying to help other Web Wiz Guide users.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.