Précédent   Forum des professionnels en informatique > PHP > Langage > Débuter
Débuter Forum d'entraide pour débuter en PHP. Avant de poster -> Cours PHP, FAQ PHP, Outils PHP, etc.
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 04/12/2010, 22h08   #1
Candidat au titre de Membre du Club
 
Inscription : juillet 2009
Messages : 193
Détails du profil
Informations personnelles :
Localisation : France

Informations forums :
Inscription : juillet 2009
Messages : 193
Points : 12
Points : 12
Par défaut lien PHPSESSID =

Bonsoir,
voila je ne c'est pas d'où peut provenir se truc :
Citation:
&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 :
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
Citation:
?action=results
et pas comme sa
Citation:
?action=results"&PHPSESSID=e98a37ede65f60eddac4ca373fd17… ?
Cordialement Stéphane
snip74 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 04/12/2010, 22h25   #2
Expert Confirmé
 
Avatar de Séb.
 
Inscription : mars 2005
Messages : 2 817
Détails du profil
Informations personnelles :
Âge : 34
Localisation : France

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

Informations forums :
Inscription : mars 2005
Messages : 2 817
Points : 3 442
Points : 3 442
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
Séb. est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 04/12/2010, 22h27   #3
Membre Expert
 
Avatar de Madfrix
 
Inscription : juin 2007
Messages : 2 278
Détails du profil
Informations personnelles :
Localisation : France, Gironde (Aquitaine)

Informations forums :
Inscription : juin 2007
Messages : 2 278
Points : 2 324
Points : 2 324
Bonsoir,

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

lien

EDIT: grillé
Madfrix est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 04/12/2010, 22h30   #4
Membre chevronné
 
Inscription : juillet 2003
Messages : 625
Détails du profil
Informations forums :
Inscription : juillet 2003
Messages : 625
Points : 600
Points : 600
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))
syl2095 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 04/12/2010, 22h31   #5
Candidat au titre de Membre du Club
 
Inscription : juillet 2009
Messages : 193
Détails du profil
Informations personnelles :
Localisation : France

Informations forums :
Inscription : juillet 2009
Messages : 193
Points : 12
Points : 12
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
snip74 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 04/12/2010, 22h40   #6
Candidat au titre de Membre du Club
 
Inscription : juillet 2009
Messages : 193
Détails du profil
Informations personnelles :
Localisation : France

Informations forums :
Inscription : juillet 2009
Messages : 193
Points : 12
Points : 12
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 :
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
snip74 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 04/12/2010, 22h40   #7
Expert Confirmé
 
Avatar de Séb.
 
Inscription : mars 2005
Messages : 2 817
Détails du profil
Informations personnelles :
Âge : 34
Localisation : France

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

Informations forums :
Inscription : mars 2005
Messages : 2 817
Points : 3 442
Points : 3 442
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
Séb. est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 09h28.


 
 
 
 
Partenaires

Hébergement Web