Hi
I have adapted a code From Yrahen (pb code), in AGK.
It's an example to use a php page and SendHTTPRequest() which works fine

.
You can do a lot of things with that kind of codes (a tchat, a simple online game (very basic, but it could work), online hi-score and a lots of things.
I have not add security test (with header for example), but it's an example to show how to use AGk and a simple PHP code :
Source :
in 2014, Yrahen has created a code (in Purebasic and PHP) to create a tchat system with no server, no DataBase, and simple.
I have adapted this code for AppGameKit

.
The AppGameKit code :
+ Code Snippet// Project: Tchat test
// Created: 21-11-23
SetErrorMode(2)
// set window properties
SetWindowTitle( "Tchat (agk+php)" )
SetWindowSize( 1024, 600, 0 )
// set display properties
SetVirtualResolution( 1024, 600 ) // doesn't have to match the window
UseNewDefaultFonts( 1 )
// create variables
Global iHttp, delayHttpResponse, MyURL$
// the delay to get info from our "tchat.php" page
delayHttpResponse = 2000
// your url here :
MyURL$ = "YourURL.com"
CreateText(1,"")
SetTextSize(1,20)
CreateEditBox(0)
SetEditBoxPosition(0,0, 570)
SetEditBoxSize(0,1024,30)
SetEditBoxTextSize(0,30)
// main loop
do
If GetPointerPressed()
y = getpointery()
StartTchaty = y -TchatY
endif
if GetPointerState()
y = getpointery()
TchatY = y -StartTchaty
SetTextPosition(1,0,TchatY)
endif
If GetRawKeyReleased(13) // enter
Message$ = GetEditBoxText(0)
if message$ <> ""
// send a message in the tchat.
// create an http connection :
iHTTP = CreateHTTPConnection()
SetHTTPHost( iHTTP, MyURL$, 0 )
// if the server takes a long time to respond this could make the app unresponsive
// change the pseudo here :)
pseudo$="AGK2"
// it's necessary to encode it (for some words)
Message$ = HTTPEncode(Message$)
// but, it seems the HTTPEncode() doesn't works for accents.
Message$ = ReplaceString(Message$,"?","%C3%A9",-1)
Message$ = ReplaceString(Message$,"?","%C3%A8",-1)
Message$ = ReplaceString(Message$,"?","%C3%A2",-1)
Message$ = ReplaceString(Message$,"?","%C3%B4",-1)
Message$ = ReplaceString(Message$,"?","%C3%A0",-1)
Message$ = ReplaceString(Message$,"?","%C3%AA",-1)
Message$ = ReplaceString(Message$,"?","%C3%B9",-1)
Message$ = ReplaceString(Message$,"?","%C3%A7",-1)
// the create the string for szServerFile for SendHTTPRequest()
post$ = "tchat.php?Action=Post&Pseudo="+Pseudo$+"&Message="+Message$
// we could use Asynchronous, that doesn't wait for the response, because we doesn't need it
Response$= SendHTTPRequest( iHTTP, post$)
// just if we want to check the status of the request()
int= GetHTTPStatusCode( iHTTP )
//~ message(REsponse$)
//~ message(str(int))
CloseHTTPConnection(iHTTP)
DeleteHTTPConnection(iHTTP)
if GetDeviceBaseName()<> "android"
SetEditBoxFocus(0,1)
SetEditBoxText(0,"")
endif
endif
SetEditBoxFocus(0,1)
endif
Refresh()
// Print( "Server response: " + response$ )
Sync()
loop
Function Refresh()
// to refresh the connection to get the new message from the php script
// you can change the delay if you want.
IF delayHttpResponse > Screenfps()/2
// create a new httpconnection
iHTTP = CreateHTTPConnection()
SetHTTPHost( iHTTP, MyURL$, 0 )
// set the string for SendHTTPRequest
url$ ="tchat.php?Action=Refresh"
r$ = SendHTTPRequest( iHTTP, url$ )
// then get the response, and if it's not "", we can add it to the tchat.
if r$ <> ""
response$ = ReplaceString(r$,"<br/>",Chr(10),-1)
response$ = ReplaceString(response$,"\'","'",-1)
response$ = ReplaceString(response$,"\"+chr(34),chr(34),-1) // \"
SetTextString(1,response$)
endif
// int= GetHTTPStatusCode( iHTTP )
delayHttpResponse = 0
CloseHTTPConnection(iHTTP)
DeleteHTTPConnection(iHTTP)
else
inc delayHttpResponse
endif
Endfunction
The PHP script : should be in your website (web server), name it tchat.php (or anything you want, but don't forget to change the name in the agk code

).
+ Code SnippetTchat.php :
<?php
if(!is_file('Tchat.txt'))
{
$Tchat=array();
file_put_contents('Tchat.txt', serialize($Tchat));
}
if(isset($_GET['Action']))
{
if($_GET['Action']=='Post' AND isset($_GET['Pseudo']) AND isset($_GET['Message']))
{
$Tchat=unserialize(file_get_contents('Tchat.txt'));
$Tchat[time()]=$_GET['Pseudo'].':'.$_GET['Message'];
file_put_contents('Tchat.txt', serialize($Tchat));
}
elseif($_GET['Action']=='Refresh')
{
$Tchat=unserialize(file_get_contents('Tchat.txt'));
ksort($Tchat);
foreach($Tchat as $Time => $Message)
{
echo $Message.'<br/>';
}
}
}
?>
I hope this can be usefull

A+