Hi every1,

i was just wondering if i can write a new php document in php using fwrite.

The variable should contain all the php code.

I know all the fread,fwrite stuff, the only thing i wanto know is how to escape the <?php ?> tags during parsing.

4 exmpl :

 $phpCode = '<?php echo "life is great" ?>';

;

Any and all help will b greatly appreciated.

Thanx

    fputs($cFile, "<?\r\n");

    I cannot stress strongly enough the words "not recommended" if writing anything other than cached includes or something basic with this though.

    Unless running on a standalone computer and checking the scripts throughaly (can't spell atm :s) afterwards before they go anywhere near the real world.

      jc94062 wrote:

      (snip) I cannot stress strongly enough the words "not recommended" if writing anything other than cached includes or something basic with this though. (snip)

      Why would you discourage creating new PHP files via fwrite() ??

        Lol, I have a whole website based on the creation of a new PHP file for each user.

        Apache_rewrite is turned off...

          i dont undesrtand why you would ever need to do this. to me, it points to a poorly designed application.

            NO actually i want to create a new php document

              ishwar wrote:

              the only thing i wanto know is how to escape the <?php ?> tags during parsing.

              No need. If you've got

               $phpCode = '<?php echo "life is great" ?>'; 

              , just fwrite($filehandle, $phpCode);

                Write a Reply...