Undefined index page

RM50Man Messages postés 314 Date d'inscription mercredi 1 novembre 2000 Statut Membre Dernière intervention 20 août 2006 - 24 mai 2005 à 00:47
arnal69130 Messages postés 445 Date d'inscription lundi 17 février 2003 Statut Membre Dernière intervention 22 mars 2007 - 24 mai 2005 à 16:01
Voilla mon erreur c undefines index page je comprend pas, si kelkun peut m expliquer merci!!!

include("htmlpage.php");
include("admin/connect.php");
//include_once("session.php");
session_start();
Function Modif_path($path)
{
$longpath = strlen($path) - 3;
return substr($path, 3, $longpath);


}


$Reqsql = "SELECT EMPLACEMENT, DESCRIPTION FROM IMAGE";
if($res = mysql_query($Reqsql))
{
if(isset($_SESSION['page']))
{
$i = 0;
$_SESSION['page'] = array(15);
while($result = mysql_fetch_object($res))
{
$_SESSION['page'][$i] = $result->EMPLACEMENT;
$_SESSION['page'][$i++] = $result->DESCRIPTION;
$i++;


}
}
$i = 0;
$path = Modif_path($_SESSION['page'][$i]);

CodeHautPage();
echo '
';
$x = 1;
echo $_SESSION['page'][$x];

CodeBasPage();


}

RM50man

4 réponses

GAME2OVR Messages postés 40 Date d'inscription samedi 25 décembre 2004 Statut Membre Dernière intervention 12 juin 2005
24 mai 2005 à 08:40
ton code ma l'air correct...



il te met une ligne d'erreur ?? peut tu nous donner c/c lerreur ??

Merci ^^, mieu avec les couleur..



<tbody>
<tr>
<td style="padding-bottom: 1px; padding-top: 0px; height: 14px;">

<?php


</td></tr><tr>
<td style="padding-bottom: 1px; padding-top: 0px; height: 14px;">

include("htmlpage.php");


</td></tr><tr>
<td style="padding-bottom: 1px; padding-top: 0px; height: 14px;">

include("admin/connect.php");


</td></tr><tr>
<td style="padding-bottom: 1px; padding-top: 0px; height: 14px;">

//include_once("session.php");


</td></tr><tr>
<td style="padding-bottom: 1px; padding-top: 0px; height: 14px;">

session_start();


</td></tr><tr>
<td style="padding-bottom: 1px; padding-top: 0px; height: 14px;">

Function Modif_path($path)


</td></tr><tr>
<td style="padding-bottom: 1px; padding-top: 0px; height: 14px;">

{


</td></tr><tr>
<td style="padding-bottom: 1px; padding-top: 0px; height: 14px;">

$longpath = strlen($path) - 3;


</td></tr><tr>
<td style="padding-bottom: 1px; padding-top: 0px; height: 14px;">

return substr($path, 3, $longpath);


</td></tr><tr>
<td style="padding-bottom: 1px; padding-top: 0px; height: 14px;">




</td></tr><tr>
<td style="padding-bottom: 1px; padding-top: 0px; height: 14px;">




</td></tr><tr>
<td style="padding-bottom: 1px; padding-top: 0px; height: 14px;">

}


</td></tr><tr>
<td style="padding-bottom: 1px; padding-top: 0px; height: 14px;">




</td></tr><tr>
<td style="padding-bottom: 1px; padding-top: 0px; height: 14px;">

$Reqsql = "SELECT EMPLACEMENT, DESCRIPTION FROM IMAGE";


</td></tr><tr>
<td style="padding-bottom: 1px; padding-top: 0px; height: 14px;">

if($res = mysql_query($Reqsql))


</td></tr><tr>
<td style="padding-bottom: 1px; padding-top: 0px; height: 14px;">

{


</td></tr><tr>
<td style="padding-bottom: 1px; padding-top: 0px; height: 14px;">

if(isset($_SESSION['page']))


</td></tr><tr>
<td style="padding-bottom: 1px; padding-top: 0px; height: 14px;">

{


</td></tr><tr>
<td style="padding-bottom: 1px; padding-top: 0px; height: 14px;">

$i = 0;


</td></tr><tr>
<td style="padding-bottom: 1px; padding-top: 0px; height: 14px;">

$_SESSION['page'] = array(15);


</td></tr><tr>
<td style="padding-bottom: 1px; padding-top: 0px; height: 14px;">

while($result = mysql_fetch_object($res))


</td></tr><tr>
<td style="padding-bottom: 1px; padding-top: 0px; height: 14px;">

{


</td></tr><tr>
<td style="padding-bottom: 1px; padding-top: 0px; height: 14px;">

$_SESSION['page'][$i] = $result->EMPLACEMENT;


</td></tr><tr>
<td style="padding-bottom: 1px; padding-top: 0px; height: 14px;">

$_SESSION['page'][$i++] = $result->DESCRIPTION;


</td></tr><tr>
<td style="padding-bottom: 1px; padding-top: 0px; height: 14px;">

$i++;


</td></tr><tr>
<td style="padding-bottom: 1px; padding-top: 0px; height: 14px;">




</td></tr><tr>
<td style="padding-bottom: 1px; padding-top: 0px; height: 14px;">




</td></tr><tr>
<td style="padding-bottom: 1px; padding-top: 0px; height: 14px;">

}


</td></tr><tr>
<td style="padding-bottom: 1px; padding-top: 0px; height: 14px;">

}


</td></tr><tr>
<td style="padding-bottom: 1px; padding-top: 0px; height: 14px;">

$i = 0;


</td></tr><tr>
<td style="padding-bottom: 1px; padding-top: 0px; height: 14px;">

$path = Modif_path($_SESSION['page'][$i]);


</td></tr><tr>
<td style="padding-bottom: 1px; padding-top: 0px; height: 14px;">




</td></tr><tr>
<td style="padding-bottom: 1px; padding-top: 0px; height: 14px;">

CodeHautPage();


</td></tr><tr>
<td style="padding-bottom: 1px; padding-top: 0px; height: 14px;">

echo '
';


</td></tr><tr>
<td style="padding-bottom: 1px; padding-top: 0px; height: 14px;">

$x = 1;


</td></tr><tr>
<td style="padding-bottom: 1px; padding-top: 0px; height: 14px;">

echo $_SESSION['page'][$x];


</td></tr><tr>
<td style="padding-bottom: 1px; padding-top: 0px; height: 14px;">




</td></tr><tr>
<td style="padding-bottom: 1px; padding-top: 0px; height: 14px;">

CodeBasPage();


</td></tr><tr>
<td style="padding-bottom: 1px; padding-top: 0px; height: 14px;">




</td></tr><tr>
<td style="padding-bottom: 1px; padding-top: 0px; height: 14px;">




</td></tr><tr>
<td style="padding-bottom: 1px; padding-top: 0px; height: 14px;">

}

</td></tr></tbody>
0
GAME2OVR Messages postés 40 Date d'inscription samedi 25 décembre 2004 Statut Membre Dernière intervention 12 juin 2005
24 mai 2005 à 08:41
il ma encore fait des misère avec les tableaux ^^
0
malalam Messages postés 10839 Date d'inscription lundi 24 février 2003 Statut Membre Dernière intervention 2 mars 2010 25
24 mai 2005 à 11:13
Hello,



bah ca veut dire que ton code ne connait pas de $_SESSION['page'].
Cette clef du tableau de variables de session n'existe pas, tu ne l'as
pas definie (pas encore je suppose) au moment ou tu t'en sers.

En fait ton erreur doit etre la :

$_SESSION['page'] = array(15);

Cette ligne est inutile de toutes manieres.
0
arnal69130 Messages postés 445 Date d'inscription lundi 17 février 2003 Statut Membre Dernière intervention 22 mars 2007 2
24 mai 2005 à 16:01
Salut,
Elle est sur quelle ligne l'erreur ? Es-tu sur qu'elle est dans le fichier dont tu as mis le code ?

Arn;o)
0
Rejoignez-nous