Index du Forum » » Questions

Auteur

$variable écrite dans un fichier
colonelwog
1947       
 

  Posté : 15-06-2010 11:50

je dois ecrire une $variable qui doit rester tel quelle or quand j'ouvre en ecriture et ferme comme c est une variable et qu'elle est vide bah il ne l'ecrit pas dans le fichier or j'en ai besoin ,est ce que quelqu'un sait comment écrire $variable pour que cela reste tel quel dans le fichier php voici le code :


<?php
/********************************************************************* *****************************/
/* Module de gestion de slideshow pour NPD S                           & nbsp;            &n bsp;            &nb sp;  */
/* ===================================================                 & nbsp;            &n bsp;            &nb sp; */
/* (c) 2010-2011 colonelwog - http://www.outils.npds.free.fr                                      */
/*            &nb sp;            &nbs p;              ;                           & nbsp;            &n bsp;            &nb sp;    */
/* This program is free software. You can& nbsp;redistribute it and/or modify it under the&n bsp;terms of     */
/* the GNU General Public License as publi shed by the Free Software Foundation;    ;                 */
/* of the License.       &n bsp;            &nb sp;            &nbs p;              ;                           & nbsp;      */
/**************************************************************************** **********************/
/**************************************************************************** **********************/
/* Page Principale        & nbsp;            &n bsp;            &nb sp;            &nbs p;              ;                    */
/**************************************************************************** **********************/

if (!strstr($PHP_SELF,"admin.php")) { Access_Error(); }

if (
$admin) {

global 
$site_font$title$NPDS_Prefix$ModPath$language;





   
$resultat= "SELECT * FROM ".$NPDS_Prefix."slideshow ";
   
$reponse   = sql_query($resultat)or die(mysql_error());
   
  // récupération des données du formulair es


$fp = fopen("modules/slideshow/fpss/slideshows/demoslideshow/da ta.php", 'w+');

        
$php = "<?php\n"
              ; ."  
$slides = array(\n";
        while (
$res = sql_fetch_assoc($reponse)) {

            $php .= "\t   array( \n";
            $php .= "\t\t 'slidelink' => '".$res['link']."' , \n";
            $php .= "\t\t 'title' => '".$res['title']."' , \n";
            $php .= "\t\t 'category' => '".$res['subtitle']."' , \n";
            $php .= "\t\t 'tagline' => '".$res['thumbdescriptif']."' , \n";
            $php .= "\t\t 'text' => '\'".$res['description']."'  , \n";
            $php .= "\t\t 'slideimage' => '".$res['image']."' \n";
              ;
$php .= "),\n";

        }
       
        
$php .= ");\n";
        
$php .= "?>\n";
        fputs(
$fp$php );
        fclose(
$fp);



   // Paramètres utilisé par le scrip t
   
$ThisFile = "admin.php?op=Extend-Admin-SubModule&amp;ModPath=$ModPath&amp;ModStart=admin/admin";




}
!include! ("footer.php");
?>





Cet article provient de NPDS

http://www.npds.org/viewtopic.php?topic=24870&forum=9