Ok, I just need help with this and then I'm done
Firstly I want myFile (the bit in bold) to equal "user".txt so if user = John then myFile John.txt, how would I do that?<?php
$x = $_POST['position'];
$user = $_POST['user'];
$myFile = <here>;
$fh = fopen($myFile, 'w') or die("can't open file");
fwrite($fh, $x);
fclose($fh);
echo "success";
?>
Secondly I want it so if the textfile doesn't exist then it creates it with permissions "7 7 7".
Could someone maybe tell me how to do it and then the PHP side of things is all done![]()


Reply With Quote




