0

so i have the following code and is not working

// Make user folder
            if (!is_dir('../user/'.$name)) {
                $user_folder = mkdir('../user/'.$name, 0777);
                $user_index = copy('../login/user.php', '../user/'.$name.'/index.php');
                if ($handle_append = fopen('../user'.$name.'index.php', 'w')) {
                    echo 'Succes opening the file';
                } else {
                    echo 'Error opening the file';
                    die();
                }
                $string = 'text to write';
                if (fwrite($handle_append, $string)) {
                    echo 'Succes writing the file';
                } else {
                    echo 'Error writing the file';
                    die();
                }
                fclose($handle_append);
                $user_inf = copy('../login/user_inf.php', '../user/'.$name.'/user_inf.php');
            } else {
                echo 'Acest nume de utilizator există deja, te rugăm alege alt nume!';
                exit(); 
            }
1
Contributor
3
Replies
9
Views
4 Years
Discussion Span
Last Post by andreiviziru
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.