Système de session PHP

Mammouth du PHP | 1967 Messages

03 juin 2020, 13:24

essaye un var_dump($_POST); pour voir quelle index existe et tu peux utiliser.
Spols
pour les fan de rubik's cube ou pour les curieux ==> le portail francophone du rubik's cube

Eléphanteau du PHP | 22 Messages

03 juin 2020, 14:28

Où dois-je placer le var_dump($_POST); ?

Eléphanteau du PHP | 22 Messages

04 juin 2020, 11:05

Ok c'est bon pour le problème précédent, mais en voilà un autre qui se pose à moi.
Dans mon système d'enregistrement de valeur dans le planning, j'ai une liste déroulante pour sélectionner un jour :
			<label for="jour">Sélectionner un jour :</label>
					<select id="jour" name="jour" value="lundi">
						<?php
						$req1=$bdd->query('SELECT * FROM planning');
						while ($donne2=$req1->fetch()) {
                                                ?>
						<option <?php echo "value='".$donne2['jour']."'"; ?>>
							<?php echo $donne2['jour']; ?>
						</option>
						<?php
						}
						?>
					</select>
Les erreurs associées à cette partie sont les suivantes :
[04-Jun-2020 09:04:05 UTC] PHP Notice: Undefined index: jour in C:\wamp64\www\gestionplanning.php on line 175
[04-Jun-2020 09:04:05 UTC] PHP Stack trace:
[04-Jun-2020 09:04:05 UTC] PHP 1. {main}() C:\wamp64\www\gestionplanning.php:0
[04-Jun-2020 09:04:05 UTC] PHP Notice: Undefined index: jour in C:\wamp64\www\gestionplanning.php on line 176
[04-Jun-2020 09:04:05 UTC] PHP Stack trace:
[04-Jun-2020 09:04:05 UTC] PHP 1. {main}() C:\wamp64\www\gestionplanning.php:0
[04-Jun-2020 09:04:05 UTC] PHP Notice: Undefined index: jour in C:\wamp64\www\gestionplanning.php on line 175
[04-Jun-2020 09:04:05 UTC] PHP Stack trace:
[04-Jun-2020 09:04:05 UTC] PHP 1. {main}() C:\wamp64\www\gestionplanning.php:0
[04-Jun-2020 09:04:05 UTC] PHP Notice: Undefined index: jour in C:\wamp64\www\gestionplanning.php on line 176
[04-Jun-2020 09:04:05 UTC] PHP Stack trace:
[04-Jun-2020 09:04:05 UTC] PHP 1. {main}() C:\wamp64\www\gestionplanning.php:0
[04-Jun-2020 09:04:05 UTC] PHP Notice: Undefined index: jour in C:\wamp64\www\gestionplanning.php on line 175
[04-Jun-2020 09:04:05 UTC] PHP Stack trace:
[04-Jun-2020 09:04:05 UTC] PHP 1. {main}() C:\wamp64\www\gestionplanning.php:0
[04-Jun-2020 09:04:05 UTC] PHP Notice: Undefined index: jour in C:\wamp64\www\gestionplanning.php on line 176
[04-Jun-2020 09:04:05 UTC] PHP Stack trace:
[04-Jun-2020 09:04:05 UTC] PHP 1. {main}() C:\wamp64\www\gestionplanning.php:0
[04-Jun-2020 09:04:05 UTC] PHP Notice: Undefined index: jour in C:\wamp64\www\gestionplanning.php on line 175
[04-Jun-2020 09:04:05 UTC] PHP Stack trace:
[04-Jun-2020 09:04:05 UTC] PHP 1. {main}() C:\wamp64\www\gestionplanning.php:0
[04-Jun-2020 09:04:05 UTC] PHP Notice: Undefined index: jour in C:\wamp64\www\gestionplanning.php on line 176
[04-Jun-2020 09:04:05 UTC] PHP Stack trace:
[04-Jun-2020 09:04:05 UTC] PHP 1. {main}() C:\wamp64\www\gestionplanning.php:0
[04-Jun-2020 09:04:05 UTC] PHP Notice: Undefined index: jour in C:\wamp64\www\gestionplanning.php on line 175
[04-Jun-2020 09:04:05 UTC] PHP Stack trace:
[04-Jun-2020 09:04:05 UTC] PHP 1. {main}() C:\wamp64\www\gestionplanning.php:0
[04-Jun-2020 09:04:05 UTC] PHP Notice: Undefined index: jour in C:\wamp64\www\gestionplanning.php on line 176
[04-Jun-2020 09:04:05 UTC] PHP Stack trace:
[04-Jun-2020 09:04:05 UTC] PHP 1. {main}() C:\wamp64\www\gestionplanning.php:0
[04-Jun-2020 09:04:05 UTC] PHP Notice: Undefined index: jour in C:\wamp64\www\gestionplanning.php on line 175
[04-Jun-2020 09:04:05 UTC] PHP Stack trace:
[04-Jun-2020 09:04:05 UTC] PHP 1. {main}() C:\wamp64\www\gestionplanning.php:0
[04-Jun-2020 09:04:05 UTC] PHP Notice: Undefined index: jour in C:\wamp64\www\gestionplanning.php on line 176
[04-Jun-2020 09:04:05 UTC] PHP Stack trace:
[04-Jun-2020 09:04:05 UTC] PHP 1. {main}() C:\wamp64\www\gestionplanning.php:0
[04-Jun-2020 09:04:05 UTC] PHP Notice: Undefined index: jour in C:\wamp64\www\gestionplanning.php on line 175
[04-Jun-2020 09:04:05 UTC] PHP Stack trace:
[04-Jun-2020 09:04:05 UTC] PHP 1. {main}() C:\wamp64\www\gestionplanning.php:0
[04-Jun-2020 09:04:05 UTC] PHP Notice: Undefined index: jour in C:\wamp64\www\gestionplanning.php on line 176
[04-Jun-2020 09:04:05 UTC] PHP Stack trace:
[04-Jun-2020 09:04:05 UTC] PHP 1. {main}() C:\wamp64\www\gestionplanning.php:0
[04-Jun-2020 09:04:05 UTC] PHP Notice: Undefined index: jour in C:\wamp64\www\gestionplanning.php on line 175
[04-Jun-2020 09:04:05 UTC] PHP Stack trace:
[04-Jun-2020 09:04:05 UTC] PHP 1. {main}() C:\wamp64\www\gestionplanning.php:0
[04-Jun-2020 09:04:05 UTC] PHP Notice: Undefined index: jour in C:\wamp64\www\gestionplanning.php on line 176
[04-Jun-2020 09:04:05 UTC] PHP Stack trace:
[04-Jun-2020 09:04:05 UTC] PHP 1. {main}() C:\wamp64\www\gestionplanning.php:0
[04-Jun-2020 09:04:05 UTC] PHP Notice: Undefined index: jour in C:\wamp64\www\gestionplanning.php on line 175
[04-Jun-2020 09:04:05 UTC] PHP Stack trace:
[04-Jun-2020 09:04:05 UTC] PHP 1. {main}() C:\wamp64\www\gestionplanning.php:0
[04-Jun-2020 09:04:05 UTC] PHP Notice: Undefined index: jour in C:\wamp64\www\gestionplanning.php on line 176
[04-Jun-2020 09:04:05 UTC] PHP Stack trace:
[04-Jun-2020 09:04:05 UTC] PHP 1. {main}() C:\wamp64\www\gestionplanning.php:0

Avez-vous une idée de comment pallier à ce problème ?
Merci d'avance

Mammouth du PHP | 1967 Messages

04 juin 2020, 12:55

Il semble que l'index 'jour' n'existe pas. ne connaissant pas ta structure de BDD, je ne sais pas t'aider.

mais si tu remplace le <option .../option> par un <?php var_dump($donne2);?> tu verra ce qui existe comme index que tu pourras utiliser.
Spols
pour les fan de rubik's cube ou pour les curieux ==> le portail francophone du rubik's cube