AKalair Posted February 12, 2009 Share Posted February 12, 2009 Hello, I'm trying to create a threaded discussion site using PHP. Currently all the titles and messages are stored in a database. I want to be able to create pages automatically when someone posts a message with a new title. So for example if someone posted a message with the title "Cheese" I want a page called "/cheese" to be made where it lists all the messages with the cheese title. How can I do this? Thanks Link to comment https://forums.phpfreaks.com/topic/144988-solved-how-to-generate-pages-on-the-fly-with-php/ Share on other sites More sharing options...
The Little Guy Posted February 12, 2009 Share Posted February 12, 2009 I believe you are look for .htaccess This may work (untested): Options +FollowSymlinks RewriteEngine On RewriteBase / RewriteRule (.+?)$ processfile.php?title=$1[NC,L] Link to comment https://forums.phpfreaks.com/topic/144988-solved-how-to-generate-pages-on-the-fly-with-php/#findComment-760777 Share on other sites More sharing options...
samshel Posted February 12, 2009 Share Posted February 12, 2009 you will need mod_rewrite enabled for this to work. There is lot of help available on the net for this ! Link to comment https://forums.phpfreaks.com/topic/144988-solved-how-to-generate-pages-on-the-fly-with-php/#findComment-760792 Share on other sites More sharing options...
medaswho Posted February 13, 2009 Share Posted February 13, 2009 if i am correct, you mean you want to write a page on the fly title (for example) cheese.php, or cheese.htm? the way to do this is with php function fputs() or fwrite(). the syntax is : fwrite($filename, "sometext"), where some text can be text in quotes or text stored in a variable. then when replies to "cheese.php" are necessary, you can append or rewrite the page as you see fit...hope that helps Link to comment https://forums.phpfreaks.com/topic/144988-solved-how-to-generate-pages-on-the-fly-with-php/#findComment-761241 Share on other sites More sharing options...
AKalair Posted February 13, 2009 Author Share Posted February 13, 2009 Thanks for the help guys Link to comment https://forums.phpfreaks.com/topic/144988-solved-how-to-generate-pages-on-the-fly-with-php/#findComment-761378 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.