How do I create a file in php? I have tried using...
$num = file_get_contents('qnum/qnum.txt');
$newFile = 'question'.$num.'.txt';
$newNum = $num++;
$openingQNUM = fopen('qnum/qnum.txt','w');
echo fwrite($openingQNUM,$newNum);
fclose($openingQNUM);
and I know I have called the functions right cause it is giving me the following error messages:
Warning: fopen(qnum/qnum.txt) [function.fopen]: failed to open stream: Permission denied in D:\Hosting\11017597\html\Question Site\ask.php on line 16
Warning: fwrite() expects parameter 1 to be resource, boolean given in D:\Hosting\11017597\html\Question Site\ask.php on line 17
Warning: fclose() expects parameter 1 to be resource, boolean given in D:\Hosting\11017597\html\Question Site\ask.php on line 18
Can someone tell me what I am doing wrong?