Bonjour, j'aimerais généré un fichier xml pour chaque validation et certaine information vienne de phpmyadmin voici le code html et php suivi du code xml:
xml:
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 <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>Description de la conference </title> <link rel="stylesheet" href=""> </head><body> <form action="recupdonee.php" method="post" > <fieldset> <legend>Description de la conference</legend> <center><p><label for="Titre">Titre : <input name="Titre" type="text"></label></P> <p><label for="Sujet">Sujet : <input name="Sujet"type="text"></label></p></center> </fieldset><fieldset> <legend>Niveaux</legend> <center> <?php $bdd = new PDO("mysql:host=localhost;dbname=techdays;charset=utf8", "root", ""); $req = $bdd-> query ("SELECT * FROM niveau"); while($resultatNiv = $req->fetch()) { echo "<input type='radio' value='".$resultatNiv['NIVEAU']."' name='niveau'>".$resultatNiv['NIVEAU']."   "; } ?> </center></fieldset><fieldset> <legend>Outils et Technologie Utilise</legend> <center> <?php $bdd = new PDO("mysql:host=localhost;dbname=techdays;charset=utf8", "root", ""); $req = $bdd-> query ("SELECT * FROM technologie"); while($resultatTech = $req->fetch()) { echo "<input type='checkbox' value='".$resultatTech['NOMTECHNO']."' name='niveau'>".$resultatTech['NOMTECHNO']."   "; } ?> </center></fieldset><fieldset> <legend>A destination</legend> <center> <?php $bdd = new PDO("mysql:host=localhost;dbname=techdays;charset=utf8", "root", ""); $req = $bdd-> query ("SELECT * FROM metier"); while($resultatMetier = $req->fetch()) { echo "<input type='checkbox' value='".$resultatMetier['LIBELLEMETIER']."' name='niveau'>".$resultatMetier['LIBELLEMETIER']."   "; } ?> </center></fieldset><fieldset> <legend>Vos Coordonnees</legend> <center><p><label for="Nom">Nom :<input name="Nom" type="text" </label></P> <p><label for="Prenom">Prenom :<input name="Prenom" type="text"></label></p> <p><label for="Mail">Mail :<input name="Mail" type="text"></label></P> <p><label for="Twitter">Twitter :<input name="Twitter" type="text"></label></p> <p><label for="Facebook">Facebook :<input name="Facebook" type="text"></label></P> <p><label for="Entreprise">Entreprise :<input name="Entreprise" type="text"></label></p></center> </fieldset><fieldset> <legend>Entreprise</legend> <center><p><label for="Entreprise_c">Entreprise :<input name="Entreprise_c" type="text"></label> <input type="radio" name="Microsoft" value="PM" > Partenaire Microsoft<br></P></center> </fieldset> <center><input type="Submit" value="Envoyer" name="Envoyer"/> <input type="reset" value="Annuler"> </center> </form> </body> </html>
merci de votre attention
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 <?php $today = date("m.d.y"); $Titre = $_POST['Titre']; $Sujet = $_POST['Sujet']; $Niveaux = $_POST['Niveaux']; $Outils_et_techn = $_POST['Outils_et_techn']; $A_destination = $_POST['A_destination']; $Preciser = $_POST['Preciser']; $Nom = $_POST['Nom']; $Prenom = $_POST['Prenom']; $Mail = $_POST['Mail']; $Twitter = $_POST['Twitter']; $Facebook = $_POST['Facebook']; $Entreprise = $_POST['Entreprise']; $Entreprise_c = $_POST['Entreprise_c']; $Microsoft = $_POST['Microsoft']; echo $Titre; echo "<br>"; echo $Sujet; echo "<br>"; echo $Niveaux; echo "<br>"; echo $Outils_et_techn; echo "<br>"; echo $A_destination; echo "<br>"; echo $Preciser; echo "<br>"; echo $Nom; echo "<br>"; echo $Prenom; echo "<br>"; echo $Mail; echo "<br>"; echo $Twitter; echo "<br>"; echo $Facebook; echo "<br>"; echo $Entreprise; echo "<br>"; echo $Entreprise_c; echo "<br>"; echo $Microsoft; $record-fopen("$today, $Titre.xml", "a+"); fwrite($record, "<titre>".$Titre."<Sujet>".$Sujet."<Niveaux>".$Niveaux."<Outils_et_techn".$Outils_et_techn."<A_destination>" .$A_destination."<Preciser".$Preciser."<Nom>".$Nom."<Prenom>".$Prenom."<Mail>".$Mail."<Twitter>" .$Twitter."<Facebook>".$Facebook."<Entreprise>".$Entreprise."<Entreprise>".$Entreprise_c ); fclose($record); ?>
Partager