ich scheitere derzeit echt an einer, für mich mittlerweile zum Geduldsspiel werdenden, Aufgabe.
In der Theorie ist es so einfach, Daten per Post Befehl ans .php script, antwort empfangen und sich freuen.
In der Praxis passiert leider.... Nichts. Ich weiss nicht wo der Fehler liegt, da ich keine Möglichkeit kenne, den Fehler zu orten, bzw zu finden.
Code entstammt dem englischen PB Forum, soll auch funktionieren (hatte es selber vorher so angegangen, aber warum das Rad neu erfinden, wenn es schon umgesetzt wurde

Code: Alles auswählen
;
; All stuff for the WinInet lib.
;
#INTERNET_OPEN_TYPE_DIRECT = 1
#HTTP_ADDREQ_FLAG_ADD = $20000000
#HTTP_ADDREQ_FLAG_REPLACE = $80000000
#INTERNET_FLAG_SECURE = $800000
;
; Type of connection (could be FTP Gopher etc). HTTPS is done as HTTP too.
;
#INTERNET_SERVICE_HTTP = 3
;
; HTTP port is 80, HTTPS (SSL) port is 443.
;
#INTERNET_DEFAULT_HTTP_PORT = 443
Procedure do_post()
;
; Do NOT include http:// or any other protocol indicator here
;
;host.s = "secure.example.com"
host.s = "tools.gw-tactics.de"
;
; Everything after the hostname of the server
;
;get_url.s = "/pb_test.php"
get_url.s = "/ddd.php"
;
; Holds the result from the CGI/page
;
;result.s = ""
result.s = ""
;
; All from the wininet DLL
;
; Be sure your Internet Explorer is up to date!
;
open_handle = InternetOpen_("User Agent Info Goes Here",#INTERNET_OPEN_TYPE_DIRECT,"","",0)
connect_handle = InternetConnect_(open_handle,host,#INTERNET_DEFAULT_HTTP_PORT,"","",#INTERNET_SERVICE_HTTP,0,0)
request_handle = HttpOpenRequest_(connect_handle,"POST",get_url,"","",0,#INTERNET_FLAG_SECURE,0)
headers.s = "Content-Type: application/x-www-form-urlencoded" +Chr(13)+Chr(10)
HttpAddRequestHeaders_(request_handle,headers,Len(headers), #HTTP_ADDREQ_FLAG_REPLACE | #HTTP_ADDREQ_FLAG_ADD)
post_data.s = "testval=5"
post_data_len = Len(post_data)
send_handle = HttpSendRequest_(request_handle,"",0,post_data,post_data_len)
Buffer.s = Space(1024)
bytes_read.l
total_read.l
total_read = 0
;
; Read until we can't read anymore..
; The string "result" will hold what ever the server pushed at us.
;
Repeat
InternetReadFile_(request_handle,@Buffer,1024,@bytes_read)
result + Left(Buffer,bytes_read)
Buffer = Space(1024)
Until bytes_read=0
Debug result
EndProcedure
do_post()
Wenns jemand ans laufen bekommt, wäre ich dafür seeehr Dankbar.