How would I create a file in a specific directory?
this is my code at the moment :
$username = $_POST["username"];
$filedir = "./u/".$username;
mkdir($filedir);
$folder = $filedir;
chmod($filedir, 0777);
$createfile = fopen( $_SERVER['DOCUMENT_ROOT'] . '/path/filename.php' );
I HAVE GOT IT!!! It was
$createfile = fopen('./u/'.$username.'/'.$username.'.php', 'x');
Answer was this :
$createfile = fopen('./u/'.$username.'/'.$username.'.php', 'x');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With