if(!isset($_POST['txt'])) //Si la variable $_POST['membre'] n'existe pas {
$ligne = file_get_contents("test1.1.php" );
echo'<p> Je suis un gros Zéro, et pourtant j\'ai tout appris sur http://www.siteduzero.com<br> Je vous [color=green]recommande[/color] d\'aller sur ce site, vous pourrez apprendre à faire ça [color=purple]vous aussi[/color] ! </p>
<fieldset> <legend>Votre souhait</legend> <!-- Titre du fieldset -->
<p> Faites un souhait que vous voudriez voir exaucé :<br /> </p>
<p> <label for="precisions">Si "Autre", veuillez préciser :</label><br /> <textarea name="precisions" id="precisions" cols="40" rows="4" tabindex="80"></textarea> </p> </fieldset> </form> </code> Et quand je rentre ce texte la ca ne marche pas : <code type="html"> <form method="post" action="traitement.php">
<fieldset> <legend>Vos coordonnées</legend> <!-- Titre du fieldset -->
<label for="nom">Quel est votre nom ?</label><br /> <input type="text" name="nom" id="nom" tabindex="10" /><br />
Marsh Posté le 02-03-2011 à 18:27:23
Salutation voici mon souci
<code type="php">
<?php
if(!isset($_POST['txt'])) //Si la variable $_POST['membre'] n'existe pas
{
$ligne = file_get_contents("test1.1.php" );
echo'<p>
Je suis un gros Zéro, et pourtant j\'ai tout appris sur http://www.siteduzero.com<br>
Je vous [color=green]recommande[/color] d\'aller sur ce site, vous pourrez apprendre à faire ça [color=purple]vous aussi[/color] !
</p>
<form method="post" action="test.php">
<p>
<label for="txt">Comment pensez-vous que je pourrais améliorer mon site ?</label><br />
<textarea name="txt" id="txt" rows="40" cols="200" ></textarea>
<input type="submit" />
</p>
</form>';
}
else //sinon
{
$monfichier1 = fopen("c://wamp//www//TEST//creertuto//test1.1.php", "w+" );
$texte = implode("\n", array_map(create_function('$ligne', 'return "[HTML]".rtrim($ligne)."[/HTML]";'), explode("\n", $_POST['txt'])));
$texte = htmlspecialchars($texte);
$texte = nl2br($texte);
// On fait passer notre texte à la moulinette des Regex
$texte = preg_replace('#(\[HTML\].*)<h1>(.*?)</h1>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtml"><h1></SPAN><SPAN CLASS="balisehtmltexte">$2</SPAN><SPAN CLASS="balisehtml"></h1></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)<h2>(.*?)</h2>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtml"><h2></SPAN><SPAN CLASS="balisehtmltexte">$2</SPAN><SPAN CLASS="balisehtml"></h2></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)<h3>(.*?)</h3>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtml"><h3></SPAN><SPAN CLASS="balisehtmltexte">$2</SPAN><SPAN CLASS="balisehtml"></h3></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)<h4>(.*?)</h4>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtml"><h4></SPAN><SPAN CLASS="balisehtmltexte">$2</SPAN><SPAN CLASS="balisehtml"></h4></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)<h5>(.*?)</h5>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtml"><h5></SPAN><SPAN CLASS="balisehtmltexte">$2</SPAN><SPAN CLASS="balisehtml"></h5></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)<h6>(.*?)</h6>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtml"><h6></SPAN><SPAN CLASS="balisehtmltexte">$2</SPAN><SPAN CLASS="balisehtml"></h6></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)<strong>(.*?)</strong>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtml"><strong></SPAN><SPAN CLASS="balisehtmltexte">$2</SPAN><SPAN CLASS="balisehtml"></strong></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)(.*?)<br>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtmltexte">$2</SPAN><SPAN CLASS="balisehtml"><br></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)(.*?)<br />(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtmltexte">$2</SPAN><SPAN CLASS="balisehtml"><br /></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)<p>(.*?)(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtml"><p></SPAN><SPAN CLASS="balisehtmltexte">$2</SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)<em>(.*?)(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtml"><em></SPAN><SPAN CLASS="balisehtmltexte">$2</SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)<html>(.*?)(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtml"><html></SPAN><SPAN CLASS="balisehtmltexte">$2</SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)<title>(.*?)(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtml"><title></SPAN><SPAN CLASS="balisehtmltexte">$2</SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)<head>(.*?)(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtml"><head></SPAN><SPAN CLASS="balisehtmltexte">$2</SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)<body>(.*?)(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtml"><body></SPAN><SPAN CLASS="balisehtmltexte">$2</SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)<q>(.*?)(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtml"><q></SPAN><SPAN CLASS="balisehtmltexte">$2</SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)<blockquote>(.*?)(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtml"><blockquote></SPAN><SPAN CLASS="balisehtmltexte">$2</SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)<li>(.*?)(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtml"><li></SPAN><SPAN CLASS="balisehtmltexte">$2</SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)<ul>(.*?)(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtml"><ul></SPAN><SPAN CLASS="balisehtmltexte">$2</SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)<ol>(.*?)(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtml"><ol></SPAN><SPAN CLASS="balisehtmltexte">$2</SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)<dl>(.*?)(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtml"><dl></SPAN><SPAN CLASS="balisehtmltexte">$2</SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)<dt>(.*?)(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtml"><dt></SPAN><SPAN CLASS="balisehtmltexte">$2</SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)<dd>(.*?)(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtml"><dd></SPAN><SPAN CLASS="balisehtmltexte">$2</SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)<div>(.*?)(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtml"><div></SPAN><SPAN CLASS="balisehtmltexte">$2</SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)<table>(.*?)(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtml"><table></SPAN><SPAN CLASS="balisehtmltexte">$2</SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)<td>(.*?)(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtml"><td></SPAN><SPAN CLASS="balisehtmltexte">$2</SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)<tr>(.*?)(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtml"><tr></SPAN><SPAN CLASS="balisehtmltexte">$2</SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)<th>(.*?)(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtml"><th></SPAN><SPAN CLASS="balisehtmltexte">$2</SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)<caption>(.*?)(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtml"><caption></SPAN><SPAN CLASS="balisehtmltexte">$2</SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)<sup>(.*?)(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtml"><sup></SPAN><SPAN CLASS="balisehtmltexte">$2</SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)<thead>(.*?)(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtml"><thead></SPAN><SPAN CLASS="balisehtmltexte">$2</SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)<tbody>(.*?)(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtml"><tbody></SPAN><SPAN CLASS="balisehtmltexte">$2</SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)<tfoot>(.*?)(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtml"><tfoot></SPAN><SPAN CLASS="balisehtmltexte">$2</SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)<label>(.*?)(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtml"><label></SPAN><SPAN CLASS="balisehtmltexte">$2</SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)<select>(.*?)(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtml"><select></SPAN><SPAN CLASS="balisehtmltexte">$2</SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)<option>(.*?)(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtml"><option></SPAN><SPAN CLASS="balisehtmltexte">$2</SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)<fieldset>(.*?)(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtml"><fieldset></SPAN><SPAN CLASS="balisehtmltexte">$2</SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)<legend>(.*?)(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtml"><legend></SPAN><SPAN CLASS="balisehtmltexte">$2</SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)(.*?)</p>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtmltexte">$2</SPAN><SPAN CLASS="balisehtml"></p></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)(.*?)</em>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtmltexte">$2</SPAN><SPAN CLASS="balisehtml"></em></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)(.*?)</html>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtmltexte">$2</SPAN><SPAN CLASS="balisehtml"></html></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)(.*?)</title>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtmltexte">$2</SPAN><SPAN CLASS="balisehtml"></title></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)(.*?)</head>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtmltexte">$2</SPAN><SPAN CLASS="balisehtml"></head></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)(.*?)</body>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtmltexte">$2</SPAN><SPAN CLASS="balisehtml"></body></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)(.*?)</q>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtmltexte">$2</SPAN><SPAN CLASS="balisehtml"></q></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)(.*?)</blockquote>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtmltexte">$2</SPAN><SPAN CLASS="balisehtml"></blockquote></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)(.*?)</li>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtmltexte">$2</SPAN><SPAN CLASS="balisehtml"></li></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)(.*?)</ul>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtmltexte">$2</SPAN><SPAN CLASS="balisehtml"></ul></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)(.*?)</ol>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtmltexte">$2</SPAN><SPAN CLASS="balisehtml"></ol></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)(.*?)</dl>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtmltexte">$2</SPAN><SPAN CLASS="balisehtml"></dl></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)(.*?)</dt>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtmltexte">$2</SPAN><SPAN CLASS="balisehtml"></dt></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)(.*?)</dd>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtmltexte">$2</SPAN><SPAN CLASS="balisehtml"></dd></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)(.*?)</div>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtmltexte">$2</SPAN><SPAN CLASS="balisehtml"></div></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)(.*?)</table>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtmltexte">$2</SPAN><SPAN CLASS="balisehtml"></table></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)(.*?)</td>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtmltexte">$2</SPAN><SPAN CLASS="balisehtml"></td></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)(.*?)</tr>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtmltexte">$2</SPAN><SPAN CLASS="balisehtml"></tr></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)(.*?)</th>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtmltexte">$2</SPAN><SPAN CLASS="balisehtml"></th></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)(.*?)</caption>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtmltexte">$2</SPAN><SPAN CLASS="balisehtml"></caption></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)(.*?)</sup>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtmltexte">$2</SPAN><SPAN CLASS="balisehtml"></sup></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)(.*?)</thead>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtmltexte">$2</SPAN><SPAN CLASS="balisehtml"></thead></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)(.*?)</tbody>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtmltexte">$2</SPAN><SPAN CLASS="balisehtml"></tbody></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)(.*?)</tfoot>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtmltexte">$2</SPAN><SPAN CLASS="balisehtml"></tfoot></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)(.*?)</label>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtmltexte">$2</SPAN><SPAN CLASS="balisehtml"></label></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)(.*?)</fieldset>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtmltexte">$2</SPAN><SPAN CLASS="balisehtml"></fieldset></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)(.*?)</legend>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtmltexte">$2</SPAN><SPAN CLASS="balisehtml"></legend></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)<img(.*?)>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtml"><img</SPAN> $2<SPAN CLASS="balisehtml">></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)<span(.*?)>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtml"><span</SPAN> $2<SPAN CLASS="balisehtml">></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)<div(.*?)>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtml"><div</SPAN> $2<SPAN CLASS="balisehtml">></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)<ul (.*?)>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtml"><ul</SPAN> $2<SPAN CLASS="balisehtml">></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)<optgroup (.*?)>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtml"><optgroup</SPAN> $2<SPAN CLASS="balisehtml">></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)<option (.*?)>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtml"><option</SPAN> $2<SPAN CLASS="balisehtml">></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)<select (.*?)>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtml"><select</SPAN> $2<SPAN CLASS="balisehtml">></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)<textarea (.*?)>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtml"><textarea</SPAN> $2<SPAN CLASS="balisehtml">></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)<label (.*?)>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtml"><label</SPAN> $2<SPAN CLASS="balisehtml">></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)<input (.*?)/>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtml"><input</SPAN> $2<SPAN CLASS="balisehtml">></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)<form (.*?)>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtml"><form</SPAN> $2<SPAN CLASS="balisehtml">></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)<td (.*?)>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtml"><td</SPAN> $2<SPAN CLASS="balisehtml">></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)<p (.*?)>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtml"><p</SPAN> $2<SPAN CLASS="balisehtml">></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)<ol (.*?)>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtml"><ol</SPAN> $2<SPAN CLASS="balisehtml">></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)<a (.*?)>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtml"><a</SPAN> $2<SPAN CLASS="balisehtml">></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)<acronym (.*?)>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtml"><acronym</SPAN> $2<SPAN CLASS="balisehtml">></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)<html (.*?)>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtml"><html</SPAN> $2<SPAN CLASS="balisehtml">></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)<body (.*?)>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtml"><body</SPAN> $2<SPAN CLASS="balisehtml">></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)<link (.*?)>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtml"><link</SPAN> $2<SPAN CLASS="balisehtml">></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)<meta (.*?)>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtml"><meta</SPAN> $2<SPAN CLASS="balisehtml">></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)>(.*?)</a>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtmltexte">$2</SPAN><SPAN CLASS="balisehtml"></a></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)>(.*?)</acronym>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtmltexte">$2</SPAN><SPAN CLASS="balisehtml"></acronym></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)(.*?)</form>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtmltexte">$2</SPAN><SPAN CLASS="balisehtml"></form></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)(.*?)</textarea>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtmltexte">$2</SPAN><SPAN CLASS="balisehtml"></textarea></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)(.*?)</select>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtmltexte">$2</SPAN><SPAN CLASS="balisehtml"></select></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)(.*?)</option>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtmltexte">$2</SPAN><SPAN CLASS="balisehtml"></option></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)(.*?)</optgroup>(.*\[/HTML\])#', '$1<SPAN CLASS="balisehtmltexte">$2</SPAN><SPAN CLASS="balisehtml"></optgroup></SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)class="(.*?)"(.*\[/HTML\])#', '$1 <SPAN CLASS="balisehtmltype">class</SPAN>=<SPAN CLASS="balisehtmlname">"$2"</SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)accesskey="(.*?)"(.*\[/HTML\])#', '$1 <SPAN CLASS="balisehtmltype">accesskey</SPAN>=<SPAN CLASS="balisehtmlname">"$2"</SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)tabindex="(.*?)"(.*\[/HTML\])#', '$1 <SPAN CLASS="balisehtmltype">tabindex</SPAN>=<SPAN CLASS="balisehtmlname">"$2"</SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)selected="(.*?)"(.*\[/HTML\])#', '$1 <SPAN CLASS="balisehtmltype">selected</SPAN>=<SPAN CLASS="balisehtmlname">"$2"</SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)rows="(.*?)"(.*\[/HTML\])#', '$1 <SPAN CLASS="balisehtmltype">rows</SPAN>=<SPAN CLASS="balisehtmlname">"$2"</SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)cols="(.*?)"(.*\[/HTML\])#', '$1 <SPAN CLASS="balisehtmltype">cols</SPAN>=<SPAN CLASS="balisehtmlname">"$2"</SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)for="(.*?)"(.*\[/HTML\])#', '$1 <SPAN CLASS="balisehtmltype">for</SPAN>=<SPAN CLASS="balisehtmlname">"$2"</SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)size="(.*?)"(.*\[/HTML\])#', '$1 <SPAN CLASS="balisehtmltype">size</SPAN>=<SPAN CLASS="balisehtmlname">"$2"</SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)maxlength="(.*?)"(.*\[/HTML\])#', '$1 <SPAN CLASS="balisehtmltype">maxlength</SPAN>=<SPAN CLASS="balisehtmlname">"$2"</SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)value="(.*?)"(.*\[/HTML\])#', '$1 <SPAN CLASS="balisehtmltype">value</SPAN>=<SPAN CLASS="balisehtmlname">"$2"</SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)name="(.*?)"(.*\[/HTML\])#', '$1 <SPAN CLASS="balisehtmltype">name</SPAN>=<SPAN CLASS="balisehtmlname">"$2"</SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)method="(.*?)"(.*\[/HTML\])#', '$1 <SPAN CLASS="balisehtmltype">method</SPAN>=<SPAN CLASS="balisehtmlname">"$2"</SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)action="(.*?)"(.*\[/HTML\])#', '$1 <SPAN CLASS="balisehtmltype">action</SPAN>=<SPAN CLASS="balisehtmlname">"$2"</SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)colspan="(.*?)"(.*\[/HTML\])#', '$1 <SPAN CLASS="balisehtmltype">colspan</SPAN>=<SPAN CLASS="balisehtmlname">"$2"</SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)rowspan="(.*?)"(.*\[/HTML\])#', '$1 <SPAN CLASS="balisehtmltype">rowspan</SPAN>=<SPAN CLASS="balisehtmlname">"$2"</SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)id="(.*?)"(.*\[/HTML\])#', '$1 <SPAN CLASS="balisehtmltype">id</SPAN>=<SPAN CLASS="balisehtmlname">"$2"</SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)http-equiv="(.*?)"(.*\[/HTML\])#', '$1 <SPAN CLASS="balisehtmltype">http-equiv</SPAN>=<SPAN CLASS="balisehtmlname">"$2"</SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)xmlns="(.*?)"(.*\[/HTML\])#', '$1 <SPAN CLASS="balisehtmltype">xmlns</SPAN>=<SPAN CLASS="balisehtmlname">"$2"</SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)content="(.*?)"(.*\[/HTML\])#', '$1 <SPAN CLASS="balisehtmltype">content</SPAN>=<SPAN CLASS="balisehtmlname">"$2"</SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)rel="(.*?)"(.*\[/HTML\])#', '$1 <SPAN CLASS="balisehtmltype">rel</SPAN>=<SPAN CLASS="balisehtmlname">"$2"</SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)media="(.*?)"(.*\[/HTML\])#', '$1 <SPAN CLASS="balisehtmltype">media</SPAN>=<SPAN CLASS="balisehtmlname">"$2"</SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)type="(.*?)"(.*\[/HTML\])#', '$1 <SPAN CLASS="balisehtmltype">type</SPAN>=<SPAN CLASS="balisehtmlname">"$2"</SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)href="(.*?)"(.*\[/HTML\])#', '$1 <SPAN CLASS="balisehtmltype">href</SPAN>=<SPAN CLASS="balisehtmlname">"$2"</SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)title="(.*?)"(.*\[/HTML\])#', '$1 <SPAN CLASS="balisehtmltype">title</SPAN>=<SPAN CLASS="balisehtmlname">"$2"</SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)alt="(.*?)"(.*\[/HTML\])#', '$1 <SPAN CLASS="balisehtmltype">alt</SPAN>=<SPAN CLASS="balisehtmlname">"$2"</SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)src="(.*?)"(.*\[/HTML\])#', '$1 <SPAN CLASS="balisehtmltype">src</SPAN>=<SPAN CLASS="balisehtmlname">"$2"</SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)target=(.*?) (.*\[/HTML\])#', '$1 <SPAN CLASS="balisehtmltype">target</SPAN>=<SPAN CLASS="balisehtmlnameautre">$2</SPAN>$3', $texte);
$texte = preg_replace('#(\[HTML\].*)<!--(.*?)-->(.*\[/HTML\])#', '$1 <span class="balisehtmlcom"><!-- $2 --></span>$3', $texte);
// je supprime les balises HTML
$texte = preg_replace('#\[HTML\](.*)\[/HTML\]#','$1', $texte);
fputs($monfichier1, $texte);
fclose($monfichier1);
$txt = $_POST['txt'];
$monfichier2 = fopen("c://wamp//www//TEST//creertuto//test1.2.php", "w+" );
fputs($monfichier2, $txt);
fclose($monfichier2);
header('Location: ./TEST/creertuto/');
}
?>
</code>
et quand je rentre le texte suivant sa marche :
<code type="html">
<form method="post" action="traitement.php">
<fieldset>
<legend>Vos coordonnées</legend> <!-- Titre du fieldset -->
<label for="nom">Quel est votre nom ?</label><br />
<input type="text" name="nom" id="nom" tabindex="10" /><br />
<label for="prenom">Quel est votre prénom ?</label><br />
<input type="text" name="prenom" id="prenom" tabindex="20" /><br />
<label for="email">Quel est votre e-mail ?</label><br />
<input type="text" name="email" id="email" tabindex="30" /><br />
</fieldset>
<fieldset>
<legend>Votre souhait</legend> <!-- Titre du fieldset -->
<p>
Faites un souhait que vous voudriez voir exaucé :<br />
</p>
<p>
<label for="precisions">Si "Autre", veuillez préciser :</label><br />
<textarea name="precisions" id="precisions" cols="40" rows="4" tabindex="80"></textarea>
</p>
</fieldset>
</form>
</code>
Et quand je rentre ce texte la ca ne marche pas :
<code type="html">
<form method="post" action="traitement.php">
<fieldset>
<legend>Vos coordonnées</legend> <!-- Titre du fieldset -->
<label for="nom">Quel est votre nom ?</label><br />
<input type="text" name="nom" id="nom" tabindex="10" /><br />
<label for="prenom">Quel est votre prénom ?</label><br />
<input type="text" name="prenom" id="prenom" tabindex="20" /><br />
<label for="email">Quel est votre e-mail ?</label><br />
<input type="text" name="email" id="email" tabindex="30" /><br />
</fieldset>
<fieldset>
<legend>Votre souhait</legend> <!-- Titre du fieldset -->
<p>
Faites un souhait que vous voudriez voir exaucé :<br />
<input type="radio" name="souhait" value="riche" id="riche" tabindex="40" /> <label for="riche">Etre riche</label><br />
<input type="radio" name="souhait" value="celebre" id="celebre" tabindex="50" /> <label for="celebre">Etre célèbre</label><br />
<input type="radio" name="souhait" value="intelligent" id="intelligent" tabindex="60" /> <label for="intelligent">Etre <strong>encore</strong> plus intelligent</label><br />
<input type="radio" name="souhait" value="autre" id="autre" tabindex="70" /> <label for="autre">Autre...</label><br />
</p>
<p>
<label for="precisions">Si "Autre", veuillez préciser :</label><br />
<textarea name="precisions" id="precisions" cols="40" rows="4" tabindex="80"></textarea>
</p>
</fieldset>
</form>
</code>
POURQUOIIIIIIIIIIIIIIIII ???????????
---------------
sourcil power is back !!!