kamkam
07-09-2007, 10:58 AM
Hi;
I'd like to create a php file after a user submit a thread. For example, i post this thread with the title of "create a php file like this forum does",
then i want to create a php file with a name of "create-a-php-file- like-this-forum-does.php".
Could anyone tell me how i can do this, please.
I tried to create a php file as following, but it does not work.
<?php
error_reporting(e_all);
$myFile="create-a-php-file- like-this-forum-does";
$e=".php";
$myFile="$myFile$e";
$fh = fopen($myFile, 'w') or die("can't open file");
$stringData = "<html>welcome to mypage, I am testing</html>";
fwrite($fh, $stringData);
fclose($fh);
?>
I'd like to create a php file after a user submit a thread. For example, i post this thread with the title of "create a php file like this forum does",
then i want to create a php file with a name of "create-a-php-file- like-this-forum-does.php".
Could anyone tell me how i can do this, please.
I tried to create a php file as following, but it does not work.
<?php
error_reporting(e_all);
$myFile="create-a-php-file- like-this-forum-does";
$e=".php";
$myFile="$myFile$e";
$fh = fopen($myFile, 'w') or die("can't open file");
$stringData = "<html>welcome to mypage, I am testing</html>";
fwrite($fh, $stringData);
fclose($fh);
?>