website logo
Auteur
avatar
colonelwog

Forum » » Questions » » $variable écrite dans un fichier


Posté : 15 juin 2010 à 11:50 icone du post

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 NPDS                                                       */
/* ===================================================                                            */
/* (c) 2010-2011 colonelwog - http://www.outils.npds.free.fr                                      */
/*                                                                                                */
/* This program is free software. You can redistribute it and/or modify it under the terms of     */
/* the GNU General Public License as published by the Free Software Foundation;                   */
/* of the License.                                                                                */
/**************************************************************************************************/
/**************************************************************************************************/
/* Page Principale                                                                                */
/**************************************************************************************************/

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 formulaires


$fp = fopen("modules/slideshow/fpss/slideshows/demoslideshow/data.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 script
   
$ThisFile = "admin.php?op=Extend-Admin-SubModule&amp;ModPath=$ModPath&amp;ModStart=admin/admin";




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



Cet article provient de NPDS
https://www.npds.org/viewtopic.php?topic=24870&forum=9