Help with asp code

Status
Not open for further replies.

Plasdom

Ars Tribunus Angusticlavius
6,704
I d/led the codeforum asp only forum and it works fine. There is an include file that is used for deletion when in admin mode. Here is the source for the file
code:<HR>
Code:
 <%' delete.asp
%><P><%
' ***********************************************************************
' get.<P>dim id<P>id      = Request("del")<P>
' ***********************************************************************
' delete.<P>' delete one the whole branch.<P>	fh.deleteArticle(id)<P>' ***********************************************************************
' >> continue.<P>Response.Redirect fh.getUriMain(0)
%>
As you can see whole branches of posts can be deleted at one click. What I would like if possible is a message asking for confirmation of deletion before going ahead and deleting the whole post.

I figured it would be a matter of "if" and "else" statements.

Thx
 

Plasdom

Ars Tribunus Angusticlavius
6,704
After going through that it did not make sense to me. Here is a delete function that I located in another include file
code:<HR>
Code:
 ' as CString::Delete. returns the new string.
function Delete( str, index, count )
	dim l,r
	l = Left ( str, index-1 )
	r = Right( str, Len(str)-(index+count)+1 )<P>	Delete = l & r
end function
 

martin007

Ars Tribunus Militum
2,783
I don't think that delete function is the same one that the code in your first post calls.

Anyways, to display a confirmation message, I would do something like this (if you want to keep it to just one file):

code:<HR>
Code:
dim deleteTrue = Request("deleteTrue") 'passed in whatever way you want<P>if(deleteTrue)
   'delete the stuff
else
   'display confirm message and set deleteTrue to true, then redirect
   'to the same page
 
Status
Not open for further replies.