■ Ce code simule la création d'un compte, la connexion et la déconnexion.
Code : Tout sélectionner
Enumeration
#PR_Sign_Up
#PR_Sign_In
#PR_Sign_Out
EndEnumeration
Define url.s = "http://s242132022.onlinehome.fr/game01/"
Define script.s = "test.php"
Define parameters.s = "?process=" + #PR_Sign_In
Define header.s, buffer.s, *buffer
InitNetwork()
header = GetHTTPHeader(url + script)
Buffer = StringField(Header, 1, #LF$)
If FindString(Buffer, "200 OK")
*buffer = ReceiveHTTPMemory(url + script + "/" + URLEncoder(parameters))
If *buffer
Size = MemorySize(*buffer)
buffer = PeekS(*buffer, Size, #PB_UTF8|#PB_ByteLength)
FreeMemory(*buffer)
EndIf
Debug buffer
Else
Debug "connexion failed"
EndIf
Code : Tout sélectionner
<?php
define("PR_Sign_Up", 0);
define("PR_Sign_In", 1);
define("PR_Sign_Out", 2);
if (isset($_GET['process'])) {
switch (($_GET['process'])) {
case PR_Sign_Up :
echo "Account create";
break;
case PR_Sign_In :
echo "welcome";
break;
case PR_Sign_Out :
echo "bye";
break;
default:
echo '-1';
}
}
?>

Exemple : http://s242132022.onlinehome.fr/game01/ ... ?process=1
