Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Sep 2005
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Make PHP file and zip for download

    Hey I wanted to know how I can make a script where when a user hits submit a PHP file is made with information in it, then made into a zip and given for the user to download. Anyone know where I can find info on this or know a script that does this?

  • #2
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts

  • #3
    New Coder
    Join Date
    Sep 2005
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Okay that script is good, I have most of it working. Right now what I need to know is, I am using fwrite(); how can I have a php variable inputed into the file?

    I want to add this code into the file:

    PHP Code:
    <?php
    $why 
    "test";
    ?>
    This is the code I have

    PHP Code:
    $fileinfoadd = "<?phpn$why"test\";\n?>";
    //$fileinfoadd is what gets into DB.
    What I get in the file when that code is executed is this

    PHP Code:
    <?php
     
    "test";
    ?>

    How can I get what I want? Thanks.

  • #4
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    Try using single quotes
    PHP Code:
    $fileinfoadd = '<?phpn$why="test";n?>";


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •