PDA

View Full Version : Ok is this possible vB posting through ASP?


Clifford
10-29-2004, 02:27 PM
Well im on the run.. but im stuck on the posting thread part


<!--#include file="encryption/md5.asp"-->
<%
'Response.Buffer = True
Dim objXMLHTTP, xml, strUsername, strPassword

strHost = "http://host/"

strUsername = "blahblah"
strPassword = "blahblah"


Set xml = Server.CreateObject("Microsoft.XMLHTTP")

' login procedure
strPost = "?vb_login_username=" & strUsername
strPost = strPost & "&cookieuser=0"
strPost = strPost & "&s="
strPost = strPost & "&do=login"
strPost = strPost & "&forceredirect=1"
strPost = strPost & "&vb_login_md5password=" & MD5(strPassword)

' login to the board
xml.Open "POST", strHost & "/login.php" & strPost, False
xml.Send

response.Write "<h3>Login screen " & xml.Status & "</h3>"
Response.Write xml.responseText

' post procedure
strSubject = "dsdsdsdasdasdasd"
strBody = "dsadsadassdaaaaaaaaaaaaaaaaeweefefeff"

strPost = "?do=postthread"
strPost = strPost & "&f=15"
strPost = strPost & "&subject=1"
strPost = strPost & "&message=1"
strPost = strPost & "&poststarttime=" & UDate(now())
strPost = strPost & "&signature=1"
strPost = strPost & "&parseurl=1"
strPost = strPost & "&disablesmilies=1"
strPost = strPost & "&sbutton=Submit New Thread"


' post message
xml.Open "POST", strHost & "/newthread.php" & strPost, False

xml.setRequestHeader "Referer:",strHost & "/newthread.php?do=newthread&f=15"

xml.Send

response.Write "<h3>After submit screen " & xml.Status & "</h3>"
Response.Write Replace(xml.responseText,"Refresh","")

Set xml = Nothing

function UDate(oldDate)
UDate = DateDiff("s", "01/01/1970 00:00:00", oldDate)
end function
%>

The login procedure works (because the result page showed me that i was logged in as blahbla) .. but now i want to post a thread.. it just doesnt seem to work.. i get a blank result.. When i enter an invalid forum id it returns the invalid forum id message.. but when everything seems right the page returns blank and no post is created. Is there somekind of referer check on newthread.php? Or do i miss something do i miss some kind of variable? Please help me. Is it even possible :D