Php files

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Php files

    I need a little help with creating files after creating a directory.

    <?php $name = $_GET['name'];
    mkdir("$name");
    /*I want two files to be created immediately after the dir is created e.g index.php & count.txt with some values in them in the directory "$name". How do I do that?*/ ?>

    #2
    PHP Code:
    <?php
    makePage
    (
    function 
    makePage($pageContent,$pageName){
        
    $fp fopen("$pageName""w");
        
    fwrite($fp$pageContent); 
        
    fclose($fp);
        return 
    true;
    }

    $pageContent '<?php
    echo "kei_ki7";
    ?>'
    ;
    makePage($pageContent'index.php');
    ?>
    Didn't test yet. Hope it works
    Did I help you?
    You can help me too
    Your donations will help me finance my studies.

    Comment

    Working...
    X