bonjour,
Je souhaite récupérer la valeur d'un id d'une table, après avoir validé mon formulaire. Mais avec la méthode GET, je ne sais pas quoi mettre dans l'URL ( à la ligne 24 )
Mon code : Page traitement_formulaire.php
Page saisir_une_personne.php :
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 <?php /*Connexion BDD*/ include("connexion.php"); if (isset($_POST['submit'])) { if (isset($_POST['typologie']) && !empty($_POST['typologie']) && isset($_POST['nom_contact']) && !empty($_POST['nom_contact']) && isset($_POST['thematique']) && !empty($_POST['thematique']) && isset($_POST['tel_struct']) && !empty($_POST['tel_struct']) && isset($_POST['mail_struct']) && !empty($_POST['mail_struct'])) { //Récupération des valeurs des champs pour la table structure $typologie=$_POST['typologie']; $nom_contact=$_POST['nom_contact']; $thematique=$_POST['thematique']; $desc_contact=$_POST['desc_contact']; $nom_struct=$_POST['nom_struct']; $nom_service=$_POST['nom_service']; $adres_struct=$_POST['adres_struct']; $tel_struct=$_POST['tel_struct']; $fax_struct=$_POST['fax_struct']; $page_web=$_POST['page_web']; $mail_struct=$_POST['mail_struct']; $comment_struct=$_POST['comment_struct']; //Insérer dans la BDD dans la table structure $bdd->exec("INSERT INTO structure VALUES (null,'$typologie','$nom_contact','$thematique','$desc_contact','$nom_struct','$nom_service','$adres_struct','$tel_struct','$fax_struct','$page_web','$mail_struct','$comment_struct')"); } }header("location:saisir_une_personne.php?id_struct=??????????"); ?>
Merci
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12 <?php /*Connexion BDD*/ include("connexion.php"); $id_strcut=$_GET['id_struct']; echo $id_struct; ?> <html> <head></head> <body> <a href="formulaire_personne.php">Saisissez une personne : </a> </body> </html>
Partager