...

View Full Version : create a php file like this forum does



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);
?>

jabbic
07-09-2007, 11:23 AM
Hmmm do you mean like file.php?id=like_this

StupidRalph
07-09-2007, 11:53 AM
Are you trying to just create cruft free urls? If so, just use mod_rewrite. (link (http://www.ryanbrill.com/archives/cruft-free-urls/))

kamkam
07-09-2007, 08:03 PM
>Hmmm do you mean like file.php?id=like_this

yes, like that.

kamkam
07-09-2007, 08:05 PM
>Are you trying to just create cruft free urls? If so, just use mod_rewrite. (link)
Yes, and thanks for your link.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum