How to post a reply to a forum in VB ?

I created this code to post a reply to a forum (I'm testing in IPB) with Visual Basic but when I test , it worked in my localhost , but it not work with other sites and forums .

Private Sub Form_Load()
With Winsock1
    .Connect "", 80
End With
Private Sub Form_Load()
Private Sub Winsock1_Connect()
Dim strDataToSend As String

strDataToSend = "POST /index.php? HTTP/1.1" & vbCrLf
strDataToSend = strDataToSend & "Host:" & vbCrLf
strDataToSend = strDataToSend & "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20060111 Firefox/" & vbCrLf
strDataToSend = strDataToSend & "Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5" & vbCrLf
strDataToSend = strDataToSend & "Accept-Language: en-us,en;q=0.5" & vbCrLf
strDataToSend = strDataToSend & "Accept-Encoding: gzip,deflate" & vbCrLf
strDataToSend = strDataToSend & "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7" & vbCrLf
strDataToSend = strDataToSend & "Keep-Alive: 300" & vbCrLf
strDataToSend = strDataToSend & "Connection: keep-alive" & vbCrLf
strDataToSend = strDataToSend & "Cookie: member_id=1; pass_hash=91ce85d7197b57a7d3bef570f2ea4d26;" & vbCrLf
strDataToSend = strDataToSend & "Content-Type: application/x-www-form-urlencoded" & vbCrLf
strDataToSend = strDataToSend & "Content-Length: 81" & vbCrLf
strDataToSend = strDataToSend & "act=Post&CODE=03&f=19&t=57&auth_key=4eaac715c8c2ef9c057290f728590239&Post=testing" & vbCrLf
strDataToSend = strDataToSend & vbCrLf

Winsock1.SendData strDataToSend
End Sub
--------------------------------------------End of CODE-------------------------------

thanx for ur help
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

I'm not sure about this, but shouldn't there be a blank line between the headers and the data? (in this case the 'form' values)
Shouldn't this line:

strDataToSend = strDataToSend & "Content-Length: 81" & vbCrLf

be changed to:

strDataToSend = strDataToSend & "Content-Length: 81" & vbCrLf & vbcrlf

And can you elaborate what you mean by 'it worked in my localhost , but it not work with other sites and forums'

Atan Asfaloth

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Leo EikelmanDirector, IT and Business DevelopmentCommented:
you are hardcoding the host are u not?

strDataToSend = strDataToSend & "Host:" & vbCrLf

would you not have to change this every time you change location?

ktsm1809Author Commented:

be changed to:

strDataToSend = strDataToSend & "Content-Length: 81" & vbCrLf & vbcrlf

wow , thanx so much . it work now (a small but important error :D)
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

You're welcome:)
As vain as this sounds, I reccommend my own post to be accepted, since ktsm1809 quoted my solution and said it worked...
It is not at all vain to point out that you are right when you are, in fact, right :-).  I appreciate it when an Expert takes the time to recheck these old questions.  Thanks!
-- DanRollins, EE Cleanup Volunteer
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.