IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Flash Discussion :

[FLASH MX2004] Scores.php, txt


Sujet :

Flash

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre averti
    Profil pro
    Inscrit en
    Janvier 2007
    Messages
    21
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2007
    Messages : 21
    Par défaut [FLASH MX2004] Scores.php, txt
    bonjour,

    Ma version de flash : MX 2004 professionnel version 7.1

    j'ai fait un jeu en reprenant un jeu existant. Quand je le mets sur mon hébergement ovh, les scores ne sont pas sauvegardés, et en local avec un serveur php, j'ai le message d'erreur suivant :
    Notice: Undefined variable: chaine in c:\program files\easyphp1-8\www\le français\jeux\scores.php on line 8

    mon jeu swf se trouve :
    http://www.lefrancais.eu/lefrancais/Jeux/2007sego.swf

    le jeu fla se trouve au même endroit
    http://www.lefrancais.eu/lefrancais/Jeux/2007.fla

    le fichier texte et php au même endroit :
    http://www.lefrancais.eu/lefrancais/Jeux/scores.txt

    http://www.lefrancais.eu/lefrancais/Jeux/scores.php


    merci beaucoup pour votre aide

  2. #2
    Membre Expert Avatar de Lorenzo77
    Profil pro
    Inscrit en
    Mai 2006
    Messages
    1 472
    Détails du profil
    Informations personnelles :
    Âge : 53
    Localisation : France, Paris (Île de France)

    Informations forums :
    Inscription : Mai 2006
    Messages : 1 472
    Par défaut
    d'ici je peux pas voir le code PHP, mais je peux te faire la traduction des quelques mots d'anglais puisque tu ne dois pas avoir de dico ...

    Notice: Undefined variable: chaine in c:\program files\easyphp1-8\www\le français\jeux\scores.php on line 8 --> jette un oeil : variable NON DÉFINI a la ligne 8 de score.php

    donc regarde la variable qui est utilisé et non défini ... mais cette erreur est juste un avertissement et pas une erreur fatal qui coupe le script !

  3. #3
    Membre averti
    Profil pro
    Inscrit en
    Janvier 2007
    Messages
    21
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2007
    Messages : 21
    Par défaut variable chaine et contenu du fichier php
    merci pour ta réponse. Je comprends bien l'anglais mais je débute et ne trouve pas le problème. Comme j'en ai assez de chercher, je fais appel à vous.
    la variable chaine est écrite dans le jeu fla,...

    le fichier php est écrit ainsi :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    <html>
    <head>
    <title>SCORES PHP</title>
    </head>
    <?php
    $file="scores.txt"; // on indique le fichier que l'on va traiter
    $myFile=fopen("$file", "w"); // ici, on dit que l'on ouvre le fichier selectionne en écriture (donc modifiable)
    fputs($myFile,$chaine); // on écrit la varibale chaine (envoyée par Flash) dans ce fichier
    fclose($myFile); // on ferme le fichier
    echo " Votre score a bien été enregistré!"; // phrase de confirmation
    ?>
    <body bgcolor="#0099CC" text="#000000">
    Bravo !! Vous pouvez fermer cette fenêtre.
    </body>
    </HTML>
    le fichier php est à cet endroit :
    http://www.lefrancais.eu/lefrancais/Jeux/scores.php



    merci encore

  4. #4
    Membre Expert Avatar de Lorenzo77
    Profil pro
    Inscrit en
    Mai 2006
    Messages
    1 472
    Détails du profil
    Informations personnelles :
    Âge : 53
    Localisation : France, Paris (Île de France)

    Informations forums :
    Inscription : Mai 2006
    Messages : 1 472
    Par défaut
    $chaine ???? pour moi c'est plutot $_GET['chaine'] ou $_POST['chaine'] que le PHP pourrait recevoir !

    d'ailleurs cette ligne me le confirme meme si je n'ai jamais rien vu d'aussi degueulasse
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    chaine = "score1=" add tab[1] add "&joueur1=" add tab[11] add "&score2=" add tab[2] add "&joueur2=" add tab[12] add "&score3=" add tab[3] add "&joueur3=" add tab[13] add "&score4=" add tab[4] add "&joueur4=" add tab[14] add "&score5=" add tab[5] add "&joueur5=" add tab[15] add "&score6=" add tab[6] add "&joueur6=" add tab[16] add "&score7=" add tab[7] add "&joueur7=" add tab[17] add "&score8=" add tab[8] add "&joueur8=" add tab[18] add "&score9=" add tab[9] add "&joueur9=" add tab[19] add "&score10=" add tab[10] add "&joueur10=" add tab[20];
     
    getURL("scores.php?" add chaine, "_blank", "POST");
    tu n'as rien trouver de mieux pour envoyer tes vars au PHP ?
    pour info le loadVariables le fait !
    ex :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    chaine = "score1=" add tab[1] add "&joueur1=" add tab[11] add "&score2=" add tab[2] add "&joueur2=" add tab[12] add "&score3=" add tab[3] add "&joueur3=" add tab[13] add "&score4=" add tab[4] add "&joueur4=" add tab[14] add "&score5=" add tab[5] add "&joueur5=" add tab[15] add "&score6=" add tab[6] add "&joueur6=" add tab[16] add "&score7=" add tab[7] add "&joueur7=" add tab[17] add "&score8=" add tab[8] add "&joueur8=" add tab[18] add "&score9=" add tab[9] add "&joueur9=" add tab[19] add "&score10=" add tab[10] add "&joueur10=" add tab[20];
     
    loadVariablesNum("http://xx.xx.com/scores.php?" add chaine, 0, "GET");
    pour eviter les problemes dans ton TXT tu dois faire une condition sur la valeur de cette variable dans ton PHP sinon pas la peine de continuer le script si elle est vide !

  5. #5
    Membre averti
    Profil pro
    Inscrit en
    Janvier 2007
    Messages
    21
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2007
    Messages : 21
    Par défaut suite
    le fichier php fonctionne..mais
    cette fois le score qui devrait s'afficher en 1er apparait à la fin en 10ème position,

    pouvez-vous m'aider. J'offre un t-shirt à celui qui trouvera. Merci encore !

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    tab=[];
    tab[1] = score1;
    tab[2] = score2;
    tab[3] = score3;
    tab[4] = score4;
    tab[5] = score5;
    tab[6] = score6;
    tab[7] = score7;
    tab[8] = score8;
    tab[9] = score9;
    tab[10] = score10;
    tab[11] = joueur1;
    tab[12] = joueur2;
    tab[13] = joueur3;
    tab[14] = joueur4;
    tab[15] = joueur5;
    tab[16] = joueur6;
    tab[17] = joueur7;
    tab[18] = joueur8;
    tab[19] = joueur9;
    tab[20] = joueur10;
    if (score < score10)
    {
        commentaire = "Desole,  score insuffisant !";
        stop ();
    }
    else if (tab[1] < score)
    {
        tab[20] = tab[19];
        tab[19] = tab[18];
        tab[18] = tab[17];
        tab[17] = tab[16];
        tab[16] = tab[15];
        tab[15] = tab[14];
        tab[14] = tab[13];
        tab[13] = tab[12];
        tab[12] = tab[11];
        tab[10] = tab[9];
        tab[9] = tab[8];
        tab[8] = tab[7];
        tab[7] = tab[6];
        tab[6] = tab[5];
        tab[5] = tab[4];
        tab[4] = tab[3];
        tab[3] = tab[2];
        tab[2] = tab[1];
        tab[11] = name;
        tab[1] = score;
        commentaire = "Bravo, vous êtes 1er !";
        nextFrame ();
    }
    else if (tab[2] < score)
    {
        tab[20] = tab[19];
        tab[19] = tab[18];
        tab[18] = tab[17];
        tab[17] = tab[16];
        tab[16] = tab[15];
        tab[15] = tab[14];
        tab[14] = tab[13];
        tab[13] = tab[12];
        tab[10] = tab[9];
        tab[9] = tab[8];
        tab[8] = tab[7];
        tab[7] = tab[6];
        tab[6] = tab[5];
        tab[5] = tab[4];
        tab[4] = tab[3];
        tab[3] = tab[2];
        tab[12] = name;
        tab[2] = score;
        commentaire = "Bravo, vous êtes 2eme !";
        nextFrame ();
    }
    else if (tab[3] < score)
    {
        tab[20] = tab[19];
        tab[19] = tab[18];
        tab[18] = tab[17];
        tab[17] = tab[16];
        tab[16] = tab[15];
        tab[15] = tab[14];
        tab[14] = tab[13];
        tab[10] = tab[9];
        tab[9] = tab[8];
        tab[8] = tab[7];
        tab[7] = tab[6];
        tab[6] = tab[5];
        tab[5] = tab[4];
        tab[4] = tab[3];
        tab[13] = name;
        tab[3] = score;
        commentaire = "Bravo, vous êtes 3eme !";
        nextFrame ();
    }
    else if (tab[4] < score)
    {
        tab[20] = tab[19];
        tab[19] = tab[18];
        tab[18] = tab[17];
        tab[17] = tab[16];
        tab[16] = tab[15];
        tab[15] = tab[14];
        tab[10] = tab[9];
        tab[9] = tab[8];
        tab[8] = tab[7];
        tab[7] = tab[6];
        tab[6] = tab[5];
        tab[5] = tab[4];
        tab[14] = name;
        tab[4] = score;
        commentaire = "Bravo,vous êtes 4eme !";
        nextFrame ();
    }
    else if (tab[5] < score)
    {
        tab[20] = tab[19];
        tab[19] = tab[18];
        tab[18] = tab[17];
        tab[17] = tab[16];
        tab[16] = tab[15];
        tab[10] = tab[9];
        tab[9] = tab[8];
        tab[8] = tab[7];
        tab[7] = tab[6];
        tab[6] = tab[5];
        tab[15] = name;
        tab[5] = score;
        commentaire = "Bravo, vous êtes 5eme !";
        nextFrame ();
    }
    else if (tab[6] < score)
    {
        tab[20] = tab[19];
        tab[19] = tab[18];
        tab[18] = tab[17];
        tab[17] = tab[16];
        tab[10] = tab[9];
        tab[9] = tab[8];
        tab[8] = tab[7];
        tab[7] = tab[6];
        tab[16] = name;
        tab[6] = score;
        commentaire = "Bravo, vous êtes 6eme !";
        nextFrame ();
    }
    else if (tab[7] < score)
    {
        tab[20] = tab[19];
        tab[19] = tab[18];
        tab[18] = tab[17];
        tab[10] = tab[9];
        tab[9] = tab[8];
        tab[8] = tab[7];
        tab[17] = name;
        tab[7] = score;
        commentaire = "Bravo, vous êtes 7eme !";
        nextFrame ();
    }
    else if (tab[8] < score)
    {
        tab[20] = tab[19];
        tab[19] = tab[18];
        tab[10] = tab[9];
        tab[9] = tab[8];
        tab[18] = name;
        tab[8] = score;
        commentaire = "Bravo, vous êtes 8eme !";
        nextFrame ();
    }
    else if (tab[9] < score)
    {
        tab[20] = tab[19];
        tab[10] = tab[9];
        tab[19] = name;
        tab[9] = score;
        commentaire = "Bravo, vous êtes 9eme !";
        nextFrame ();
    }
    else
    {
        tab[20] = name;
        tab[10] = score;
        commentaire = "Bravo, vous êtes 10eme !";
        nextFrame ();
    } // end else if

  6. #6
    Membre chevronné Avatar de nounetmasque
    Inscrit en
    Janvier 2003
    Messages
    494
    Détails du profil
    Informations forums :
    Inscription : Janvier 2003
    Messages : 494
    Par défaut
    Citation Envoyé par stelsej
    J'offre un t-shirt à celui qui trouvera. Merci encore !
    J'espère que c une blague (en tout cas de mauvais goût) !

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. [FLASH MX2004] Variable php vers flash
    Par Rhadamanthe59 dans le forum Flash
    Réponses: 8
    Dernier message: 01/03/2006, 22h14
  2. Réponses: 1
    Dernier message: 12/09/2005, 11h28
  3. [FLASH MX2004] Caractères spéciaux et PHP
    Par Sun3clipse dans le forum Flash
    Réponses: 3
    Dernier message: 24/11/2004, 10h33
  4. Réponses: 4
    Dernier message: 05/10/2004, 17h11
  5. [FLASH MX2004] [PHP/FLASH] Probleme de LoadVar
    Par dedella_al dans le forum Flash
    Réponses: 8
    Dernier message: 16/07/2004, 18h56

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo