Hello PB friends !
Got another code for testing from a german user. And as I haven't any knowledge about network programming I will post the code here.
He tried all snippets he could find on the forums etc....
He was able to program the needed functions with WinAPI, but he want to code them with PB functions for cross-plattform etc.
The code was tested on Win98, Win98 Second Edition, ME, W2K and XP, so it shouldn't be an OS related problem.
Could you please test the code? Either its a programming fault or a possible bug...
(Notes: The URL was established extra for testing. The using of the PHP scripts is strongly needed, because most ISP's doesn't allow the access with ODBC to the MySQL.)
Here comes the used PB code:
Code: Select all
Global eol$
eol$ = Chr(13) + Chr(10)
*Buffer = AllocateMemory(0,10000,0)
If InitNetwork() = 0
 MessageRequester("Error", "Can't initialize the network !", 0)
 End
EndIf
If OpenWindow(0, 0, 0, 320, 240, #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_ScreenCentered, "INet-Highscore")
 ConnectionID= OpenNetworkConnection("[url]http://www.mduttlinger.de[/url]", 80)
 If ConnectionID
   msg$ = "GET [url]http://www.mduttlinger.de/hs2/newscore.php?hein&510&a&b&c&d&e&f&5555[/url] HTTP/1.1" + eol$
   ;SendNetworkString(ConnectionID, msg$)
   ;SendNetworkString(ConnectionID, eol$)
   PokeS(*Buffer, msg$)
   SendNetworkData(ConnectionID, *Buffer, Len(msg$))
   PokeS(*Buffer, eol$)
   SendNetworkData(ConnectionID, *Buffer, Len(eol$))
   CloseNetworkConnection(ConnectionID)
 Else
   MessageRequester("Error", "Can't create theconnection !", 0)
 EndIf
Â
 Repeat
   EventID.l = WaitWindowEvent()
   If EventID = #PB_Event_CloseWindow
     Quit = 1
   EndIf
 Until quit = 1
EndIf
FreeMemory(0)
End
Code: Select all
André
*** German PureBasic Support ***
