I have a script which creates a directory according to username, it was working fine but for some reason gave up on me. The directory isn't being created and that's why i'm getting this error (I think):
Warning: fopen(testuser/index.html) [function.fopen]: failed to open stream: No such file or directory in /home/blabla/public_html/makepage.php on line 9
can't open file
<?php
/* Variables */
$user = $_POST['user'];
$pageTitle = $_POST['pageTitle'];
$pageTitle= stripslashes($pageTitle);
$fileName = "index.html";
$fh = fopen($user."/".$fileName, 'w') or die("can't open file");
$fileData = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html>\n<head>\n<title>$pageTitle</title>\n</head>\n<body>\n\n</body>\n</html>";
/* End Variables */
mkdir($user);
fwrite($fh, $fileData);
fclose($fh);
?>
Any ideas? thanks in advance,
curly0