I had assumed that the '0.0.0.0' that you were posting as the IP address was not the actual one you were using.
I'm surprised that you got it to work at all.
If you are testing locally, the commonly used local ip address is '127.0.0.1'. And you need to have a web server running to provide the page asked for.
And do you actually have a newmessage.php file on your real server at the document root level (the domain without any sub directories)?
Try this code:
// initialise everything
i_http = 0
i_ret = 0
http$ = ""
// don't change the file name (other than to remove the leading /)
// this file actually exists up on the server
page$ = "/hi.php"
// change this to 0 for using the non-asynchronous call
i_async = 1
// this is a live and working domain
dom$ = "www.triassicgames.com"
SetVirtualResolution(320, 480)
SetOrientationAllowed(1, 0, 0, 0)
SetPrintSize(16)
// HTTP Commands
// create the initial connection
i_http = CreateHTTPConnection()
// connect to the host
i_ret = SetHTTPHost(i_http, dom$, 0)
if i_async = 1
// send the request asynchronously
i_async = SendHTTPRequestASync(i_http, page$, "")
// wait for a response
while GetHTTPResponseReady(i_http) = 0
Print("i_http="+str(i_http,0))
Print("i_ret="+str(i_ret,0))
Print("i_async="+str(i_async,0))
print("waiting for data...."+str(timer(),0))
sync()
endwhile
// get the response
http$ = GetHTTPResponse(i_http)
else
// get the 'page'
http$ = SendHTTPRequest(i_http, page$)
endif
// close up
CloseHTTPConnection(i_http)
DeleteHTTPconnection(i_http)
// hi.php returns something like "2012-05-16 12:57:45"
// show the results
do
// check for done
if getPointerPressed()=1 then end
Print("domain="+dom$)
Print("i_http="+str(i_http,0))
Print("i_ret="+str(i_ret,0))
Print("i_async="+str(i_async,0))
Print("got '"+http$+"'")
Print("Touch anywhere to exit")
Sync()
loop
You can change the value of i_async to try both request types and switch the two dom$ lines to try IP address versus actual domain name.
I own the domain and have tested that this works in Windows just fine. And it worked fine through the v10812 Player.
If the test above does NOT work for you, then you have a connection issue that has nothing to do with AGK.
Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master