Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 DEV-Group
 DEV Discussions (General)
 Bug: POST.ASP
 New Topic  Topic Locked
 Printer Friendly
Previous Page
Author Previous Topic Topic Next Topic
Page: of 2

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 17 February 2003 :  13:37:23  Show Profile
How about this? Should work as Frutz's does, just changed this around a bit.
if Request.QueryString("TOPIC_ID") <> "" then
	if IsNumeric(Request.QueryString("TOPIC_ID")) = True then
		strRqTopicID = cLng(Request.QueryString("TOPIC_ID"))
	else
		Response.Redirect("default.asp")
	end if
else
	if (strRqMethod <> "Topic" And strRqMethod <> "Forum" And strRqMethod <> "Category") then Response.Redirect("default.asp")
end if
if Request.QueryString("FORUM_ID") <> "" then
	if IsNumeric(Request.QueryString("FORUM_ID")) = True then
		strRqForumID = cLng(Request.QueryString("FORUM_ID"))
	else
		Response.Redirect("default.asp")
	end if
else
	if (strRqMethod <> "Forum" And strRqMethod <> "Category") then Response.Redirect("default.asp")
end if
if Request.QueryString("CAT_ID") <> "" then
	if IsNumeric(Request.QueryString("CAT_ID")) = True then
		strRqCatID = cLng(Request.QueryString("CAT_ID"))
	else
		Response.Redirect("default.asp")
	end if
end if
if Request.QueryString("REPLY_ID") <> "" then
	if IsNumeric(Request.QueryString("REPLY_ID")) = True then
		strRqReplyID = cLng(Request.QueryString("REPLY_ID"))
	else
		Response.Redirect("default.asp")
	end if
else
	if (strRqMethod <> "Reply" And strRqMethod <> "Topic" And strRqMethod <> "Forum" And strRqMethod <> "Category") then Response.Redirect("default.asp")
end if
Go to Top of Page

Deleted
deleted

4116 Posts

Posted - 17 February 2003 :  13:41:36  Show Profile
quote:

You named your daughter Duty?


Very good , are'nt children duty for their parents? Her name is Defne (Daphne in English), she is 10 months old and started to walk around to crash stuff. You want believe how much time she takes, so we could have named her Duty.


Stop the WAR!
Go to Top of Page

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 17 February 2003 :  13:44:43  Show Profile
quote:
Originally posted by bozden

she is 10 months old and started to walk around to crash stuff

just wait until she's two.

Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~
Go to Top of Page

Roland
Advanced Member

Netherlands
9335 Posts

Posted - 17 February 2003 :  14:11:24  Show Profile
quote:
Originally posted by Nikkol

How about this? Should work as Frutz's does, just changed this around a bit.
if Request.QueryString("TOPIC_ID") <> "" then
	if IsNumeric(Request.QueryString("TOPIC_ID")) = True then
		strRqTopicID = cLng(Request.QueryString("TOPIC_ID"))
	else
		Response.Redirect("default.asp")
	end if
else
	if (strRqMethod <> "Topic" And strRqMethod <> "Forum" And strRqMethod <> "Category") then Response.Redirect("default.asp")
end if
if Request.QueryString("FORUM_ID") <> "" then
	if IsNumeric(Request.QueryString("FORUM_ID")) = True then
		strRqForumID = cLng(Request.QueryString("FORUM_ID"))
	else
		Response.Redirect("default.asp")
	end if
else
	if (strRqMethod <> "Forum" And strRqMethod <> "Category") then Response.Redirect("default.asp")
end if
if Request.QueryString("CAT_ID") <> "" then
	if IsNumeric(Request.QueryString("CAT_ID")) = True then
		strRqCatID = cLng(Request.QueryString("CAT_ID"))
	else
		Response.Redirect("default.asp")
	end if
end if
if Request.QueryString("REPLY_ID") <> "" then
	if IsNumeric(Request.QueryString("REPLY_ID")) = True then
		strRqReplyID = cLng(Request.QueryString("REPLY_ID"))
	else
		Response.Redirect("default.asp")
	end if
else
	if (strRqMethod <> "Reply" And strRqMethod <> "Topic" And strRqMethod <> "Forum" And strRqMethod <> "Category") then Response.Redirect("default.asp")
end if



No offence, but will these codes be better than what I posted, or are you just going through the different ways of writing the same thing?
Go to Top of Page

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 17 February 2003 :  14:46:15  Show Profile
none taken. i was just eliminating the part to check for Request.QueryString("FORUM_ID") = "" and the like since that's already taken care of in the first part of the if statement. Just cuts down on the amount of time to process if only by a very small fraction of a second.

Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 17 February 2003 :  15:36:32  Show Profile
How about something like as below?

Set RequestString = Request.QueryString
strRqMethod = Empty
strRqCatID = Empty ' or 0
strRqForumID = Empty 'or  0
strRqTopicID = Empty ' or 0
strRqReplyID = Empty ' or 0
numRequestID = 0
For Each RequestItem in RequestString
  Select Case lcase(RequestItem)
   Case "method"
    strRqMethod = RequestString(RequestItem)
   Case "cat_id"
    strRqCatID = RequestString(RequestItem)
    'Call function IDValidation to Validate for Numeric values 
   Case "forum_id"
    strRqForumID = RequestString(RequestItem) 
    'Call function IDValidation to Validate for Numeric values 
   Case "topic_id"
    strRqTopicID = RequestString(RequestItem)  
    'Call function IDValidation to Validate for Numeric values 
   Case "reply_id"
    strRqReplyID = RequestString(RequestItem) 
    'Call function IDValidation to Validate for Numeric values 
  End select
Next
Set RequestString = Nothing
Select Case lcase(strRqMethod)
  Case [VALID METHODS]
   'Continue
  Case else
   'ERROR - INVALID METHOD
End select
numRequestID = strRqReplyID + strRqTopicID + strRqForumId + strRqCatID
if strRqMethod = "category" then
 'creating a new Category
elseif numRequestId = 0 then
 'ERROR - ID REQUIRED
end if


function IDValidation checks for numeric values. If value is not numeric the function returns 0.


Go to Top of Page

davemaxwell
Access 2000 Support Moderator

USA
3020 Posts

Posted - 17 February 2003 :  16:51:07  Show Profile  Visit davemaxwell's Homepage  Send davemaxwell an AOL message  Send davemaxwell an ICQ Message  Send davemaxwell a Yahoo! Message
quote:
Originally posted by Nikkol

quote:
Originally posted by bozden

she is 10 months old and started to walk around to crash stuff

just wait until she's two.



Or you HAVE two....

Dave Maxwell
Barbershop Harmony Freak
Go to Top of Page

Nathan
Help Moderator

USA
7664 Posts

Posted - 18 February 2003 :  00:18:24  Show Profile  Visit Nathan's Homepage
Who cares if column names are exposed. This is an open source forum, anyone can get the column names just by downloading a copy and looking at the access database.

Nathan Bales
CoreBoard | Active Users Download
Go to Top of Page

Roland
Advanced Member

Netherlands
9335 Posts

Posted - 18 February 2003 :  07:27:21  Show Profile
I agree with Nathan that it's not important whether or not people know the column names, but it does look better if when someone enters a wrong URL, they get redirected to default.asp instead of getting some vague error they can't do anything with.
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Previous Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.17 seconds. Powered By: Snitz Forums 2000 Version 3.4.07