make a program that posts to an .asp page that in turn will add to a .mdb database the problem is this ... if i send to the page blah.asp using the get command everything shows except for chars like @ ! etc ... how there a way that i can change these values to something that the webpage wont parse and discard as html stuff say like my post buffer is 'hey!meet me @ 3 pm'
as of now it will post as 'hey meet me 3 pm' can anyone help with this simple flaw
Posted on 2002-04-12 13:33:36 by illwill
You probably need to escape those characters using %XX, where XX is the hex value of the character..
http://www.blah.com/blah.asp?text=blah%11%22%33%44

Thomas
Posted on 2002-04-12 14:23:04 by Thomas
that what i wanted to know how to do .. like how would i detect those chars in the buffer then replace them with the appropriate hex
Posted on 2002-04-12 17:07:41 by illwill
Just get each char, compare it with the normal charsets (a-z, A-Z, 0-9 etc), if it's not output a % and the hex value of that char to the output buffer..

Thomas
Posted on 2002-04-12 17:40:44 by Thomas
If you use Post, I don't think you need this encoding at all. And I think it's probably easier anyway.
Posted on 2002-04-13 03:23:25 by Qweerdy
It depends, if you send the data from a form, you will still need the item=data&item2=data2 format, so invalid characters still have to be translated. It needs to know the difference between a normal ampersand and a seperator..
You could try and send it as a file, in that case you can send it in any format you like.

Thomas
Posted on 2002-04-13 04:08:37 by Thomas
well if im sending a get command to a .asp page how could i make it a file .... basically i want to send to www30.brinkster.com/username/get.asp

lpszAddy db "www30.brinkster.com",0
lpszString db "GET /username/get.asp?%s,%s HTTP/1.1",13,10,"Host: %s",13,10,13,10,13,10,0


the first two variables after the get.asp? contain '@!&' etc so when it posts those characters dont show... so i need some help on how to changes these to hex with as little code as possible:stupid:
Posted on 2002-04-13 12:03:47 by illwill


First of all, don't add 3 CRLFs at the end of your request, you would get 2 blank lines:

GET blah
Host: blah



The procedure you want is quite simple:
- get next char in buffer
- if in valid range A-Z, a-z, 0-9, copy to next char in output
- if not:
- output ampersand (%)
- get the hex code in ascii form, in AX for example
- output hex code (AX)
- goto next char

Thomas
Posted on 2002-04-13 12:34:59 by Thomas
lpszAddy db "www30.brinkster.com",0
lpszString db "GET /username/post.asp?%s HTTP/1.1",13,10,"Host: %s",13,10,0

ASPpost PROC
startpost:
INVOKE WSAStartup, 101h, ADDR lpWSAData
INVOKE socket, 2, 1, 0
cmp eax, INVALID_SOCKET
je error

MOV hWEBSock, EAX
MOV lpWEBSIN.sin_family, 2
INVOKE htons, 80
MOV lpWEBSIN.sin_port, ax
INVOKE gethostbyname, ADDR lpszAddy
MOV EAX,
MOV EAX,
MOV EAX,
MOV lpWEBSIN.sin_addr, EAX
INVOKE connect, hWEBSock, ADDR lpWEBSIN, SIZEOF lpWEBSIN
cmp EAX, SOCKET_ERROR
je error


INVOKE wsprintf, ADDR dwWEBStr, ADDR lpszString,addr dataTOpost, addr lpszAddy

INVOKE send, hWEBSock, ADDR dwWEBStr, EAX, 0
cmp EAX,SOCKET_ERROR
je error
INVOKE closesocket, hWEBSock
;INVOKE WSACleanup
ret
error:
INVOKE closesocket, hWEBSock
INVOKE WSACleanup
INVOKE Sleep, 5000
JMP startpost
ASPpostENDP

do i need anything else cuz its not posting to the webpage
normally to post to 1.0 in visual basic blah

GetString = "GET /username/posting.asp?verify|" & temp & " HTTP/1.0" & vbCrLf
GetString = GetString & "Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/msword, */*" & vbCrLf
GetString = GetString & "Accept-Language: en-us" & vbCrLf
GetString = GetString & "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Q312461)" & vbCrLf
GetString = GetString & "Host: www30.brinkster.com" & vbCrLf
GetString = GetString & "Connection: Close" & vbCrLf & vbCrLf
Posted on 2002-04-13 19:08:22 by illwill