
Lapin0u
|
Réponse acceptée !
Pour ceux que ça intéresse, j'ai trouvé une solution!!!!
______________________________________________________________________________________________ Dans le fichier .c qui s'affichent à la mort du personnage j'ai ajouté
#include <wininet.h> #include <windows.h>
/*score nh*/ char buf[1024];
//création de la requête sprintf(buf,"http://thenubuk.club.fr/perso.php?requete="); sprintf(buf+strlen(buf), "INSERT INTO `personnages` ( `id` , `score` , `nom` , `niveau_max` , `hp` , `hpmax` , `role` , `race` , `sexe` , `alignement` , `mort` ) VALUES ( '', '%i' ", t0->points); sprintf(buf+strlen(buf), ", '%s' ", t0->name); sprintf(buf+strlen(buf), ", '%i' ", t0->maxlvl); sprintf(buf+strlen(buf), ",'%i', '%i' ", t0->hp,t0->maxhp); sprintf(buf+strlen(buf), ",'%s' ",t0->plrole); sprintf(buf+strlen(buf), ", '%s' ",t0->plrace); sprintf(buf+strlen(buf), ", '%s' ",t0->plgend); sprintf(buf+strlen(buf), ", '%s' ",t0->plalign); sprintf(buf+strlen(buf), ", '%s' );",t0->death); //connexion au serveur web HINTERNET hInternetSession, hHttpSession; hInternetSession = InternetOpen ("mon app", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, NULL) ; hHttpSession = InternetOpenUrl( hInternetSession, buf, NULL, 0, 0, 0 ) ;
//fermeture de la connexion InternetCloseHandle( hHttpSession ); InternetCloseHandle (hInternetSession) ; _______________________________________________________________________________________________
Et dans la page perso.php j'ai mis :
// on sélectionne la base $db = mysql_connect('host', 'login', 'mdp'); mysql_select_db('nethack',$db);
// on crée la requête SQL $query = $_GET['requete'];
// on l'éxécute $result = mysql_query($query);
// on ferme la base de donnée mysql_close(); ________________________________________________________________________________________________
Si vous ne voulez pas vous prendre trop la tête avec le makefile, pensez juste à ajouter à cette ligne WINPLIBS = -lcomctl32 -lwinmm un -lwininet
Salut à tous, bientôt les sources de toute mes modifications
|