bonjour, j'ai fais un formulaire avec un xml j'arrive a récupéré les donné pour les intégré dans le xml mais j'aimerais que a chaque validation qui me créé un nouvau fichier xml voici les codes:
formulaire html
récuperation donnée:
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 <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> <select name="Niveaux" size="1"> <option>Decouverte <option>Confirme <option>Expert </select> </center> </fieldset><fieldset> <legend>Outils et Technologie Utilise</legend> <center>Selectionnez vos section : <input type="checkbox" name="Outils_et_techn" value=""> ASP.NET <input type="checkbox" name="Outils_et_techn" value=""> C# <input type="checkbox" name="Outils_et_techn" value=""> Windows 10 <input type="checkbox" name="Outils_et_techn" value=""> CSS <input type="checkbox" name="Outils_et_techn" value=""> Securite <input type="checkbox" name="Outils_et_techn" value=""> Javascript <input type="checkbox" name="Outils_et_techn" value=""> JavaCript <input type="checkbox" name="Outils_et_techn" value=""> Autre <label for="Preciser">Preciser :<input name="Preciser" type="text"></label></P><center> </fieldset><fieldset><br> <legend>A destination</legend> <center>Selectionnez : <input type="checkbox" name="A_destination" value=""> Developpers <input type="checkbox" name="A_destination" value=""> Secteur public <input type="checkbox" name="A_destination" value=""> Education <input type="checkbox" name="A_destination" value=""> Autre <label for="Preciser_2">Preciser :<input name="Preciser_2" type="text"></label></P><br></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> </body> </html>
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
66
67
68
69
70
71
72
73 <?php $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']; if(empty($_REQUEST['ok'])){ $xml = new DOMDocument("1.0","utf-8"); $xml-> load('conference.xml'); $rootTag = $xml->getElementsByTagName("document")->item(0); $dataTag = $xml->createElement("data"); $titreTag = $xml->createElement("Titre",$_REQUEST['Titre']); $SujetTag = $xml->createElement("Sujet",$_REQUEST['Sujet']); $NiveauxTag = $xml->createElement("Niveaux",$_REQUEST['Niveaux']); $Outils_et_technTag = $xml->createElement("Outils_et_techn",$_REQUEST['Outils_et_techn']); $A_destinationTag = $xml->createElement("A_destination",$_REQUEST['A_destination']); $PreciserTag = $xml->createElement("Preciser",$_REQUEST['Preciser']); $NomTag = $xml->createElement("Nom",$_REQUEST['Nom']); $PrenomTag = $xml->createElement("Prenom",$_REQUEST['Prenom']); $MailTag = $xml->createElement("Mail",$_REQUEST['Mail']); $TwitterTag = $xml->createElement("Twitter",$_REQUEST['Twitter']); $FacebookTag = $xml->createElement("Facebook",$_REQUEST['Facebook']); $EntrepriseTag = $xml->createElement("Entreprise",$_REQUEST['Entreprise']); $Entreprise_cTag = $xml->createElement("Entreprise_c",$_REQUEST['Entreprise_c']); $MicrosoftTag = $xml->createElement("Microsoft",$_REQUEST['Microsoft']); $dataTag->appendChild($titreTag); $dataTag->appendChild($SujetTag); $dataTag->appendChild($NiveauxTag); $dataTag->appendChild($Outils_et_technTag); $dataTag->appendChild($A_destinationTag); $dataTag->appendChild($PreciserTag); $dataTag->appendChild($NomTag); $dataTag->appendChild($PrenomTag); $dataTag->appendChild($MailTag); $dataTag->appendChild($TwitterTag); $dataTag->appendChild($FacebookTag); $dataTag->appendChild($EntrepriseTag); $dataTag->appendChild($Entreprise_cTag); $dataTag->appendChild($MicrosoftTag); $rootTag->appendChild($dataTag); $xml->save("conference.xml"); } 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; ?>
merci de vos reponse
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 <?xml version="1.0"?> <document> <data> <Titre/> <Sujet/> <Niveaux/> <Outils_et_techn/> <A_destination/> <Precicer/> <Nom/> <Prenom/> <Mail/> <Twitter/> <Facebook/> <Entreprise/> <Entreprise_c/> <Microsoft/> </data> </document>
cordialement,
Partager