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

Langage PHP Discussion :

lien PHPSESSID =


Sujet :

Langage PHP

  1. #1
    Membre du Club
    Profil pro
    Inscrit en
    Juillet 2009
    Messages
    207
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2009
    Messages : 207
    Points : 41
    Points
    41
    Par défaut lien PHPSESSID =
    Bonsoir,
    voila je ne c'est pas d'où peut provenir se truc :
    &PHPSESSID=e98a37ede65f60eddac4ca373fd17…
    le lien qui devrai l'affiché c'est celui la (?action=results) sans rien derrière voir exemple sur le lien ici se lien sert a voir les résultats des vote (sondage) sur la droit du site, donc je ne c'est vraiment pas comment se lien peut s'afficher avec un &PHPSESSID=e98a3…

    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
    <?php
    function head() {
    include('config.php');
    echo "<table width=\"200\" border=\"0\" cellpadding=\"1\" cellspacing=\"1\">
    <tr><td bgcolor=\"$tableborder\">
    <table width=\"198\" border=\"0\" cellpadding=\"0\" cellspacing=\"\" align=\"center\">
    <tr><td bgcolor=\"$bgcolor\">";
    }
    function foot () {
    echo "</td></tr></table></td></tr></table>";
    }
    function record($REMOTE_ADDR) {
    include('config.php');
    $fp=fopen("$ip_file", "a+");
    fputs ($fp,$REMOTE_ADDR."][".time()."\n");
    fclose($fp);
    }
    function check($REMOTE_ADDR) {
    include('config.php');
    global $valid;
    $ip=$REMOTE_ADDR;
    $data=file("$ip_file");
    $now=time();
    foreach ($data as $record) {
    $subdata=explode("][",$record);
    if ($now < ($subdata[1]+3600*$timeout)) {
    if ($ip == $subdata[0]) {
    $valid=0;
    break;
    }}}}
    //##################### Enregistrer les donn&eacute;es ##############################
    function save($answer){
    global $answer;
    include('config.php');
    $data=file($datafile);
    $subdata=explode("][",$data[$answer]);
    $subdata[2]+=1;
    $data[$answer]=implode("][", $subdata);
    $data[$answer]=$data[$answer]."\n";
    $fp=fopen($datafile,"w+");
    $a=0;
    do{
    fputs($fp,$data[$a]);
    $a++;
    }while($a<count($data));
    fclose($fp);
    }
    //########################## Afficher le formulaire ############################
    function form($php_self){
    include('config.php');
    head();
    echo "<font size=\"$fontsize\" face=\"$font\" color=\"$textcolor\"><form method=\"post\" action=\"$php_self\"><p align=\"center\">";
    $data=file($datafile);
    $question=stripslashes($data[0]);
    $nb_options=count($data)-1;
    echo "<b>$question</b></p>";
    for($nb=1;$nb <= $nb_options; $nb++){
    $option=explode("][","$data[$nb]");
    echo "<input type=\"radio\" name=\"answer\" value=\"$nb\"/> ";
    echo "$option[0]<br/>";
    }
    echo "<input type=\"hidden\" name=\"save\" value=\"yes\"/>";
    echo "<p align=\"center\"><input type=\"submit\" name=\"submit\" value=\"submit\"/></p></form></font>";
    echo "<p align=\"center\"><font size=\"$fontsize\" face=\"$font\" color=\"$textcolor\"><a href=\""; echo $php_self; echo "?action=results\">Voir les resultats</font></p>";
    foot();
    }
    //################## Fonction pour afficher les résultats ########################
    function results(){
    include('config.php');
    head();
    $data=file($datafile);
    $nb_answers=count($data);
    $votes=0;
    $a=1;
    do{
    $subdata=explode("][",$data[$a]);
    $votes += $subdata[2];
    $a++;
    }while($a < $nb_answers);
    $a=1;
    $b="answerv";
    $v=100/$votes;
    echo "<p align=\"center\"><font size=\"$fontsize\" face=\"$font\" color=\"$textcolor\"><b>$data[0] </b><br/><br/>";
    do{
    $subdata=explode("][",$data[$a]);
    $av = $subdata[2] * $v;
    echo "<font size=\"$fontsize\" face=\"$font\" color=\"$textcolor\">$subdata[0] <br/>";
    $p2v = 100-$av;
    echo "<img src=\"$subdata[1]\" width=\"$av\" height=\"10\"><img src=\"$image\" width=\"$p2v\" height=\"10\"><br/>";
    printf(" %01.1f", $av); echo"%<br/><br/>";
    $a++;
    } while ($a < $nb_answers);
    echo "<b>Nombre de vote: <span style='color:#FF0000;'> ($votes) </span><b>";
    foot();
    }
    //###################### Moteur ####################################
    check($REMOTE_ADDR);
    if ($valid=="0"){ results();}
    elseif ($action=="results") { results(); }
    elseif ($save=="yes" && $valid!="0") { save($Answer); record($REMOTE_ADDR); results();}
    elseif ($action=="save" && !empty($valid)) { results(); }
    elseif ($action!="save" && $valid!="0"){ form($php_self); }
    ?>
    donc ma question et comment faire pour que mon lien reste comme sa
    ?action=results
    et pas comme sa
    ?action=results"&PHPSESSID=e98a37ede65f60eddac4ca373fd17… ?
    Cordialement Stéphane

  2. #2
    Expert éminent
    Avatar de Séb.
    Profil pro
    Inscrit en
    Mars 2005
    Messages
    5 097
    Détails du profil
    Informations personnelles :
    Âge : 46
    Localisation : France

    Informations professionnelles :
    Secteur : High Tech - Opérateur de télécommunications

    Informations forums :
    Inscription : Mars 2005
    Messages : 5 097
    Points : 8 206
    Points
    8 206
    Billets dans le blog
    17
    Par défaut
    Cela provient de la session PHP et plus précisément de la directive session.use_trans_sid qui est à On.
    Doc : http://www.php.net/manual/en/session....use-trans-sid
    Pour éviter cela il faut passer la directive à Off.
    Un problème exposé clairement est déjà à moitié résolu
    Keep It Smart and Simple

  3. #3
    Membre émérite Avatar de Madfrix
    Profil pro
    Inscrit en
    Juin 2007
    Messages
    2 326
    Détails du profil
    Informations personnelles :
    Localisation : France, Gironde (Aquitaine)

    Informations forums :
    Inscription : Juin 2007
    Messages : 2 326
    Points : 2 566
    Points
    2 566
    Par défaut
    Bonsoir,

    ne serais ce pas parce que ta configuration ne passe pas ton id de session par cookie mais par url ?

    lien

    EDIT: grillé

  4. #4
    Membre éclairé
    Inscrit en
    Juillet 2003
    Messages
    625
    Détails du profil
    Informations forums :
    Inscription : Juillet 2003
    Messages : 625
    Points : 673
    Points
    673
    Par défaut
    Bonsoir,

    est ce que ton navigateur est configuré pour accepter les cookies ?
    Le savoir est utile que s'il est partagé par tous.
    /(bb|[^b]{2})/
    !sleep() ? array((string))

  5. #5
    Membre du Club
    Profil pro
    Inscrit en
    Juillet 2009
    Messages
    207
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2009
    Messages : 207
    Points : 41
    Points
    41
    Par défaut
    Bonsoir Séb,
    merci beaucoup de ta réponse et de ton lien j'avais déjà visité le lien que tu ma donner et traduit avec outils linguistiques google et a vrai dire je n'arrive pas a trop comprendre :$ et encore moins l'anglais lol

    Citation Envoyé par Séb. Voir le message
    Cela provient de la session PHP et plus précisément de la directive session.use_trans_sid qui est à On.
    Doc : http://www.php.net/manual/en/session....use-trans-sid
    Pour éviter cela il faut passer la directive à Off.
    Cordialement Stéphane

  6. #6
    Membre du Club
    Profil pro
    Inscrit en
    Juillet 2009
    Messages
    207
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2009
    Messages : 207
    Points : 41
    Points
    41
    Par défaut
    Bonsoir syl2095
    oui sans souci rien n'est bloquer de se coté la

    Citation Envoyé par syl2095 Voir le message
    Bonsoir,

    est ce que ton navigateur est configuré pour accepter les cookies ?


    Bonsoir Madfrix
    euh je pense que oui mais j'en suis pas sur c'est un script vote que j'ai télécharger et traduit en français avec l'outil linguistiques de google, mais je pense que ta question doit être dans se code vue qu'il y a que 3 fichiers donc config rien de spécial dedans et j'avais même lut un truc sur comment masquer sur se lien

    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
    187
    188
    189
    190
    191
    192
    193
    <?php
    //############### Edit your admin-password here ##########
     
    $password="Mon mot de passe";
     
    //#########################################################
    if(!isset($passwd) or $passwd!=$password){
    echo "<table width=\"303\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" height=\"169\" bgcolor=\"#336699\" align=\"center\"><tr><td bgcolor=\"#336699\" height=\"110\"> 
    <table width=\"311\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" bgcolor=\"#FFFFFF\" height=\"136\">
    <tr><td height=\"175\"><div align=\"center\"><font face=\"verdana, arial, helvetica, sans-serif\"><b><font size=\"2\">Entrez
    votre mot de passe d'admin!</font></b></font><br>
    </div><form name=\"form1\" method=\"post\" action=\"$PHP_SELF\"><div align=\"center\">
    <input type=\"password\" name=\"passwd\"><br><input type=\"submit\" name=\"Submit\" value=\"Login\">
    </div></form></td></tr></table></td></tr></table>";
     
    }elseif ($passwd==$password){
    if (isset($submit)){
    $fp=fopen($datafile, "w");
    fputs($fp, $question."\n");
    for($i=1; $i <=10; $i++){
    if($answer[$i]==""){ break;}
    $input=stripslashes($answer[$i])."][".$image[$i]."][".$votes[$i]."\n";
    fputs($fp, $input);
    }
    fclose($fp);
    $config="<?php\n";
    $config.="\$textcolor='$textcolor';\n";
    $config.="\$linkcolor='#FFFFFF';\n";
    $config.="\$bgcolor='$bgcolor';\n";
    $config.="\$tableborder='$tableborder';\n";
    $config.="\$timeout='$timeout';\n";
    $config.="\$ip_file='$ip_file';\n";
    $config.="\$font='$font';\n";
    $config.="\$fontsize='$fontsize';\n";
    $config.="\$datafile='$datafile';\n";
    $config.="?>";
    $fp=fopen($ip_file, "w");
    fclose($fp);
    $fp=fopen("config.php", "w");
    fputs($fp, $config);
    fclose($fp);
    echo "<div align=\"center\"><b><font face=\"verdana, arial, helvetica, sans-serif\" color=\"#00CC00\">Votre
    paramètres ont été mis à jour!</font></b></div>";
    }
     
    include('config.php');
    $data=file($datafile);
    $nb=count($data);
    ?>
    <html>
    <head>
    <title>Sondage Php</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    </head>
     
    <body bgcolor="#FFFFFF" text="#000000" link="#FFFFFF" vlink="#CCCCCC" alink="#CCCCCC">
    <table width="760" border="0" cellspacing="1" cellpadding="0" align="center" height="566">
      <tr> 
        <td bgcolor="#336699" height="6"><font face="verdana, arial, helvetica, sans-serif" size="2" color="#FFFFFF">Sondage<font size="1"> 
          by Tom Kohnen (lien mort)</font></font></td>
      </tr>
      <tr> 
        <td bgcolor="#336699" height="221"> 
          <table width="768" border="0" cellspacing="1" cellpadding="5" height="634">
            <tr> 
              <td bgcolor="#EEEDEA" height="463" valign="top"> 
                <form name="APP" method="post" action="">
                  <p><font face="verdana, arial, helvetica, sans-serif" size="2"><b><i>Paramètres 
                    sondage:</i></b><br>
                    <br>
                    </font></p>
                  <table width="753" border="0" cellspacing="1" cellpadding="3" height="396" align="center">
                    <tr> 
                      <td width="116" height="15"><font face="verdana, arial, helvetica, sans-serif" size="2"><b>Question</b></font></td>
                      <td colspan="3" height="15"> <font face="verdana, arial, helvetica, sans-serif" size="2"> 
                        <input type="text" name="question" size="100" maxlength="150" value="<?php echo stripslashes($data[0]); ?>">
                        </font></td>
                    </tr>
                    <tr> 
                      <td colspan="4" height="10">&nbsp;</td>
                    </tr>
                    <tr> 
                      <td colspan="4"><font face="verdana, arial, helvetica, sans-serif" size="2">Ici, 
                        vous pouvez entrer dans les options, les utilisateurs peuvent choisir quand ils votent, 
                        les <b>2</b> premiers doivent être remplis, laisser les autres vierges
                        si vous n'avez pas besoin!</font></td>
                    </tr>
                    <tr> 
                      <td width="116">&nbsp;</td>
                      <td width="246"> 
                        <div align="center"><font face="verdana, arial, helvetica, sans-serif" size="2"><b>réponse</b></font></div>
                      </td>
                      <td width="181"> 
                        <div align="center"><font face="verdana, arial, helvetica, sans-serif" size="2"><b>dossier Image</b></font></div>
                      </td>
    				  <td> 
                        <div align="center"><font face="verdana, arial, helvetica, sans-serif" size="2"><b>Votes</b></font></div>
                      </td>
    <?
    for($i=1; $i<=10; $i++){
    	$subdata=explode("][",$data[$i]);
     
    echo "<tr><td width=\"116\">
    <font face=\"verdana, arial, helvetica, sans-serif\" size=\"2\"><b>Option $i</b></font></td>
    <td width=\"246\"> 
    <div align=\"center\"><font face=\"verdana, arial, helvetica, sans-serif\" size=\"2\"> 
    <input type=\"text\" name=\"answer[$i]\" size=\"40\" maxlength=\"40\" value=\"$subdata[0]\"></font></div>
    </td><td width=\"181\"> 
    <div align=\"center\"><font face=\"verdana, arial, helvetica, sans-serif\" size=\"2\" > 
    <input type=\"text\" name=\"image[$i]\" size=\"25\" maxlength=\"50\" value=\"$subdata[1]\">
    </font></div></td><td width=\"181\"> 
    <div align=\"center\"><font face=\"verdana, arial, helvetica, sans-serif\" size=\"2\">
    <input type=\"text\" name=\"votes[$i]\" size=\"4\" maxlength=\"4\" value=\"$subdata[2]\">
    </font></div></td></tr>";
    }
    ?>
     
                   </table>
                  <hr width="95%" size="1" align="center" noshade>
                  <table width="753" border="0" cellspacing="1" cellpadding="1">
                    <tr bgcolor="#EEEDEA"> 
                      <td width="154" height="22"><font face="verdana, arial, helvetica, sans-serif" size="2"><b>Colors</b></font></td>
                      <td width="148" height="22">&nbsp;</td>
                      <td width="22" height="22">&nbsp;</td>
                      <td colspan="2" height="22"><font face="verdana, arial, helvetica, sans-serif" size="2"><b>Autres
                      paramètres</b></font></td>
                    </tr>
                    <tr bgcolor="#EEEDEA"> 
                      <td width="154"><font face="verdana, arial, helvetica, sans-serif" size="2">Text</font></td>
                      <td width="148"> <font face="verdana, arial, helvetica, sans-serif" size="2"> 
                        <input type="text" name="textcolor" maxlength="10" size="10" value="<?php echo $textcolor; ?>">
                        </font></td>
                      <td width="22">&nbsp;</td>
                      <td width="218"><font face="verdana, arial, helvetica, sans-serif" size="2">Heure 
                        (Timeout)</font></td>
                      <td width="205"> <font face="verdana, arial, helvetica, sans-serif" size="2"> 
                        <input type="text" name="timeout" size="3" maxlength="3" value="<?php echo $timeout; ?>">
                        </font></td>
                    </tr>
                    <tr bgcolor="#EEEDEA"> 
                      <td width="154"><font face="verdana, arial, helvetica, sans-serif" size="2">Background</font></td>
                      <td width="148"> <font face="verdana, arial, helvetica, sans-serif" size="2"> 
                        <input type="text" name="bgcolor" size="10" maxlength="10" value="<?php echo $bgcolor; ?>">
                        </font></td>
                      <td width="22">&nbsp;</td>
                      <td width="218"><font face="verdana, arial, helvetica, sans-serif" size="2">Fichier
                      où les données sont stockées</font></td>
                      <td width="205"> <font face="verdana, arial, helvetica, sans-serif" size="2"> 
                        <input type="text" name="datafile" size="25" maxlength="50" value="<?php echo $datafile; ?>">
                        </font></td>
                    </tr>
                    <tr bgcolor="#EEEDEA"> 
                      <td width="154"><font face="verdana, arial, helvetica, sans-serif" size="2">bordure</font></td>
                      <td width="148"> <font face="verdana, arial, helvetica, sans-serif" size="2"> 
                        <b> 
                        <input type="text" name="tableborder" size="10" maxlength="10" value="<?php echo $tableborder; ?>">
                        </b> </font></td>
                      <td width="22"><font face="verdana, arial, helvetica, sans-serif" size="2"></font></td>
                      <td width="218"><font face="verdana, arial, helvetica, sans-serif" size="2">Fichier
                        où les adresses IP sont stockées</font></td>
                      <td width="205"> <font face="verdana, arial, helvetica, sans-serif" size="2"> 
                        <input type="text" name="ip_file" size="25" maxlength="50" value="<?php echo $ip_file; ?>">
                        </font></td>
                    </tr>
                    <tr bgcolor="#EEEDEA"> 
                      <td width="154"><font face="verdana, arial, helvetica, sans-serif" size="2">Font</font></td>
                      <td width="148"> <font face="verdana, arial, helvetica, sans-serif" size="2"> 
                        <input type="text" name="font" size="20" maxlength="100" value="<?php echo $font; ?>">
                        </font></td>
                      <td width="22"><font face="verdana, arial, helvetica, sans-serif" size="2"></font></td>
                      <td width="218"><font face="verdana, arial, helvetica, sans-serif" size="2">Taille de la police</font></td>
                      <td width="205"> <font face="verdana, arial, helvetica, sans-serif" size="2"> 
                        <input type="text" name="fontsize" value="<?php echo $fontsize; ?>" size="1" maxlength="1">
                        </font></td>
                    </tr>
                  </table>
                  <div align="center">
                    <input type="hidden" name="passwd" value="<?php echo $password; ?>">
                    <hr width="95%" size="1" align="center" noshade>
                    <input type="submit" name="submit" value="Sauvegardez vos modifications">
                    <input type="reset" name="Submit2" value="Reset">
                  </div>
                </form>
                <p>&nbsp; </p>
                </td>
            </tr>
          </table>
        </td>
      </tr>
    </table>
    </body>
    </html>
    <?php } ?>
    Citation Envoyé par Madfrix Voir le message
    Bonsoir,

    ne serais ce pas parce que ta configuration ne passe pas ton id de session par cookie mais par url ?

    lien

    EDIT: grillé

    Cordialement Stéphane

  7. #7
    Expert éminent
    Avatar de Séb.
    Profil pro
    Inscrit en
    Mars 2005
    Messages
    5 097
    Détails du profil
    Informations personnelles :
    Âge : 46
    Localisation : France

    Informations professionnelles :
    Secteur : High Tech - Opérateur de télécommunications

    Informations forums :
    Inscription : Mars 2005
    Messages : 5 097
    Points : 8 206
    Points
    8 206
    Billets dans le blog
    17
    Par défaut
    Citation Envoyé par snip74 Voir le message
    et traduit avec outils linguistiques google
    En haut de la page il y a "view this page in", t'auras une bien meilleure traduction qu'avec Google ;-)
    Et puis il y a d'autres réponses que la mienne pour t'aiguiller.

    Edit : grillé.
    Un problème exposé clairement est déjà à moitié résolu
    Keep It Smart and Simple

Discussions similaires

  1. [FLASH 5] Comment créer un lien hypertexte
    Par ajit dans le forum Flash
    Réponses: 4
    Dernier message: 30/03/2006, 12h26
  2. [Kylix] pb avec lien symbolique
    Par sdoura2 dans le forum EDI
    Réponses: 1
    Dernier message: 13/12/2002, 22h16
  3. [Kylix] Création d'un fichier lien
    Par DrQ dans le forum EDI
    Réponses: 2
    Dernier message: 14/05/2002, 21h30
  4. Tutoriels et liens pour le Borland Database Engine
    Par Community Management dans le forum Paradox
    Réponses: 0
    Dernier message: 25/03/2002, 10h23

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