Just a quick assessment, but
test your connection first, so you can handle not even being able to connect to the site.
This approach works for me.
http_Connection=CreateHTTPConnection()
SetHTTPHost(http_Connection,"<site>",0)
// 1=site up, 0=site down
// have a test method in your site that returns something you can check. If you want to keep something happening on screen, use Async with sync().
function http_test_connection()
Result=0
SendHTTPRequestAsync(http_Connection,"/mytestmethod")
Repeat
Sync()
Until GetHTTPResponseReady(http_Connection)<>0
a$=GetHTTPResponse(http_Connection)
if a$="OK" then Result=1
endfunction Result
Send all the URL data which isn't the "site" as one string. You will have to assemble this string yourself like:
/method?arg1=val1&arg2=val2&arg3=val3
Are you able to test your postmessage.php from a browser? Whatever it takes to construct the browser URL to work, just assemble the same structure.
I assume php (I'm no expert) requires the usual ? and & chars on the URL ?
One final thing to remember is that you should URL encode any data that has (or could have) special chars (including spaces).
Here's a couple of functions for that:
function URLEncode(Source$)
for x=1 to Len(Source$)
Result$=Result$+"%"+hex(asc(mid(Source$,x,1)))
next x
endfunction Result$
function URLDecode(Source$)
for x=1 to CountStringTokens(Source$,"%")
Result$=Result$+chr(Val(GetStringToken(Source$,"%",x)))
next x
endfunction Result$