<?php
#rendre le source php accessible en txt(safari) ou en rtf(explorer)
copy("fires2a.php","fires2a.txt");copy("fires2a.php","fires2a.rtf");
$imax=25;
$msg="";if(!empty($_POST["nom"])){$msg=$_POST["nom"];}
#pour alice supprimer ici les slashes
$msg=stripslashes($msg);
#remplacer ici !#xxx#! par <img src='xxx.gif' > dans $msg
$msg=str_replace('*#','<img src=',$msg);
$msg=str_replace('#*','.gif >',$msg); 
#remplacer ici http... par un lien cliquable
$a='<a href="';$b='" target="blank" > lienweb </a>';
$Zm=explode(" ",$msg);$cm=count($Zm);
for($i=0;$i<$cm;$i++) {if(substr($Zm[$i],0,4)=="http"){$Zm[$i]=$a.$Zm[$i].$b;}}
$msg=implode(" ",$Zm);
#ajouter le nouveau message au fichier stock.txt 
$fh=fopen("stock.txt","a");
$msg=$msg."\n";fwrite($fh,$msg);fclose($fh);
$Fh=file("stock.txt");$c=count($Fh);$fh=fopen("stock.txt","w");
if($c<$imax){$imax=$c;}
for($i=$c-$imax;$i<$c-0.5;$i++){fwrite($fh,$Fh[$i]);}
fclose($fh);
#retourner à la page de saisie et affichage
header("Location: caroline.php");
#<script language='javascript'> window.history.back() </script>
?>