

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | <?php // D'abord on insère notre class require('./require/class.php'); // Ou avec include include('./include/class.php'); session_start(); if(isset($_SESSION['ini'])) $ini_objet=unserialize($_SESSION['ini']); else $ini_objet=new ini(); // Ensuite, on traite le formulaire avec PHP - voire à la suite /* Insérez le code de traitement du formulaire ICI */ $_SESSION['ini']=serialize($ini_objet); /* La ligne précédente et les 5 plus haut permettent de sauvegarder les opérations réalisées dans une variable de session et donc, de pouvoir circuler dans un .ini en plusieurs chargements de page. */ ?> |
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 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | <html> <head> <title>Traitement INI</title> <style> form { margin:0px; padding:0px; } fieldset { margin-right:10px; margin-bottom:8px; border:1px black solid; } legend { color:#333333; font-style:italic; font-weight:bolder; font-size:18px; } </style> </head> <body> <div style="float:right;"> <div style="width:400px; padding:6px; margin-right:12px; border:1px solid black;"> <div style="float:right; text-align:right;"> <? $stat=$ini_objet->m_count(); echo '<strong>'.$stat[1].'éléments</strong> dans ce fichier<br /> dont <strong>'.$stat[0].'groupes</strong> et <strong>'.$stat[2].' items</strong>.<br /> <strong>'.$ini_objet->m_count($ini_objet->groupe).' items</strong> dans ce groupe.'; ?> </div> <u><i><b>Information sur le curseur</b></i></u><br /> <? $ini_objet->print_curseur(); ?> </div> <div style="width:400px; height:400px; overflow:auto; padding:6px; margin-top:12px; margin-right:12px; border:1px solid black;"> <u><i><b>Aperçu du <? if(is_dir($ini_objet->fichier)) echo 'dossier'; else echo 'fichier'; ?></b></i></u><br /><br /> <span style="font-family:courier; white-space:nowrap;"><? if(is_dir($ini_objet->fichier)) $ini_objet->print_dossier(); else $ini_objet->print_fichier(); ?></span> </div> </div> <fieldset><legend>Fichier</legend> <form method="post" action=""> <label>Fichier : <input type="text" name="source" /></label><br /> <input type="submit" name="fichier" value="Changer" /> </form> <form method="post" action=""> <input type="submit" name="fichier" value="Supprimer" /> </form> </fieldset> <fieldset><legend>Groupe</legend> <form method="post" action=""> <label>Groupe : <input type="text" name="source" /></label><br /> <input type="submit" name="groupe" value="Changer" /> </form> <form method="post" action=""> <input type="submit" name="groupe" value="Supprimer" /> </form> </fieldset> <fieldset><legend>Item</legend> <form method="post" action=""> <label>Item : <input type="text" name="source" /></label><br /> <input type="submit" name="item" value="Changer" /> </form> <form method="post" action=""> <input type="submit" name="item" value="Supprimer" /> </form> </fieldset> <fieldset><legend>Valeur</legend> <form method="post" action=""> <label>Valeur : <input type="text" name="source" /></label><br /> <input type="submit" name="valeur" value="Changer" /> </form> <form method="post" action=""> <input type="submit" name="valeur" value="Supprimer" /> </form> </fieldset> <br /> <fieldset><legend>Réinitialiser</legend> <form method="post" action=""> <input type="submit" name="clear" value="Effacer" /> </form> </fieldset> </body> </html> |
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 | <?php include('./include/class.php'); session_start(); if(isset($_SESSION['ini'])) $ini_objet=unserialize($_SESSION['ini']); else $ini_objet=new ini(); if(isset($_GET['fichier'])) { $dossier=$ini_objet->fichier; $dossier=preg_replace('#/$#','',$dossier).'/'; $ini_objet->m_fichier($dossier.$_GET['fichier']); header('Location:./ini.php5'); } if(isset($_POST['clear'])) { $ini_objet->clear(); } if(isset($_POST['fichier'])) { if($_POST['fichier']=='Changer') { $ini_objet->m_fichier(stripslashes($_POST['source'])); } elseif($_POST['fichier']=='Supprimer') { $ini_objet->s_fichier(); } } if(isset($_POST['groupe'])) { if($_POST['groupe']=='Changer') { $ini_objet->m_groupe(stripslashes($_POST['source'])); } elseif($_POST['groupe']=='Supprimer') { $ini_objet->s_groupe(); $ini_objet->save(); } } if(isset($_POST['item'])) { if($_POST['item']=='Changer') { $ini_objet->m_item(stripslashes($_POST['source'])); } elseif($_POST['item']=='Supprimer') { $ini_objet->s_item(); $ini_objet->save(); } } if(isset($_POST['valeur'])) { if($_POST['valeur']=='Changer') { $ini_objet->m_put(stripslashes($_POST['source'])); $ini_objet->save(); } elseif($_POST['valeur']=='Supprimer') { $ini_objet->m_put(''); $ini_objet->save(); } } $_SESSION['ini']=serialize($ini_objet); ?> |
Changer de design |
En savoir plus |
Plan du site |
Politique d'accessibilité |
Règles |
Fil RSS |
XHTML 1.0 |
CSS 2.0
Édité par Simple IT SARL :
Nous contacter
| Revue de presse | Publicité
Y'a plus rien à lire, faut remonter maintenant !
Hébergement web - Correction de tutoriels - Créer un site
Vous souhaitez apparaître ici ? Contactez-nous.
294 Zéros connectés |
9 requêtes |
0.0496s (0.0371s)