function GetHighScores() con = CreateHTTPConnection() httpsOn = 0 //set whether you want to use SSL connection or not - we're not using one for this example. domain$ = "www.YourDomainName.com" directoryUserName$ = "myUserName" directoryPassword$ = "myPassword" secureDirectory = 1 directoryName$ = "myProtectedDirectory/" scriptName$ = "getscores.php" //Set the host for the connection if secureDirectory = 1 SetHTTPHost(con , domain$ , httpsOn , directoryUserName$ , directoryUserPassword$) else SetHTTPHost(con , domain$ , httpsOn) endif //We do not need to send post data to this script, but you may wish to do so. post$ = "" //Initiate the request - I prefer async so we can give the user a waiting screen while the connection is working. SendHTTPRequestASync(con , directoryName$ + scriptName$ , post$) time0 = GetMilliseconds() repeat timeNow = GetMilliseconds() timeElapsed = (timeNow - time0) Print("Time elapsed " + str(timeElapsed)) //Here we'd have an actual waiting animation or message. ready = GetHTTPResponseReady(con) if ready <> 0 or timeElapsed > 60000 //set a timeout limit done = 1 endif Sync() until done = 1 if ready = 1 // We got a response! We're not using response codes this time for simplicity. response$ = GetHTTPResponse(con) Message(response$) elseif ready = -1 //Report there was a connection error - this could happen due to a lost internet connection or the server failed to respond. Message("Server connection failed") else //Report there was a timeout error. Message("Server connection failed - timeout") endif CloseHTTPConnection(con) DeleteHTTPConnection(con) endfunction