Add a post in a forum - نوشته شده در (1416 Views)
New Member
kyodai
مطلب: 74
74
I know it sounds stupid, but i would like to have an asp page that adds a post to a (secret) forum. We have an app which is checking our backend server (The one for videos, images and so on) and can report system state by calling a website.
What i need is an asp page that adds a post to a specific forum, like when i call it http://mysite.com/pager.asp?Message=Server%20Down&Detail=The%20Server%20is%20down%20since%2009:34

so it would make a post in the admin forum that has the subject "Server down" and the message text "The Server is down since 09:34".
I fumbled a lot with it but simply didn't get it to work, it looks like it should work, but i never see the post.


I tried it with a raw SQL statement as i had no better idea. Can anyone help?

Code:

strSql = "INSERT INTO " & strTablePrefix & "TOPICS ("
strSql = strSql & " CAT_ID"
strSql = strSql & ", FORUM_ID"
strSql = strSql & ", T_SUBJECT"
strSql = strSql & ", T_AUTHOR"
strSql = strSql & ", T_MESSAGE"
strSql = strSql & ") VALUES ("
strSql = strSql & " '" & "2" & "'"
strSql = strSql & ", '" & "60" & "'"
strSql = strSql & ", '" & "Test Subject" & "'"
strSql = strSql & ", '" & "1" & "'"
strSql = strSql & ", '" & "The Server is down test test test" & "'"

my_Conn.Execute (strSql)
 پیش‌فرض مرتب‌سازی برای تاریخ DESC به معنی جدیدترین است  
 تعداد در صفحه 
نوشته شده در
New Member
kyodai
مطلب: 74
74
nvm, i just added

<!--#INCLUDE FILE="inc_sha256.asp" -->
<!--#INCLUDE FILE="inc_header_short.asp" -->
<!--#INCLUDE FILE="inc_func_member.asp" -->

besides config.asp to the includes and it works. Dun get why these were required, prolly something i overlooked. Anyways, what counts is it works now.
نوشته شده در
Average Member
cripto9t
مطلب: 881
881
you need inc_header_short or inc_header because the database connection (my_Conn) is created and opened there. It's closed and destroyed in inc_footer_short.
    _-/Cripto9t\-_
 
شما باید یک متن وارد کنید