Dillon Posted January 8, 2010 Share Posted January 8, 2010 Hello, I am learning PHP on my own, I want to make a flat file forum with php. I dont know where to start. I am not sure how to make an array for the language file or anything? Does anyone have suggestions how to start? What different methods would I have to use (functions, etc.). I have heard that flat file is terrible with big websites, because it takes longer to load... Any suggestions how to do this? Thanks! -Dillon Quote Link to comment Share on other sites More sharing options...
Mchl Posted January 8, 2010 Share Posted January 8, 2010 It's not terrible for big sites. It's terrible for any site that is larger-than-tiny. You could start with learning about sqlite which is an embedded flat file database. Or you might think again, and consider using some actual database. Quote Link to comment Share on other sites More sharing options...
Psycho Posted January 8, 2010 Share Posted January 8, 2010 You are asking a lot to be addressed in a forum post. But, if you are new to PHP I would suggest not building your own flat file database from scratch. There are some freely available modules that you can use. Just do a google seach for "php flat file database" and you'll find some good resources. But, a better question is why would you want to use a flat-file database? There are very cheap host (and even free ones I believe) that provide MySQL database support. Doesn't make sense to learn how to use some less than optimal solution when you can do it the right way. Quote Link to comment Share on other sites More sharing options...
MadTechie Posted January 8, 2010 Share Posted January 8, 2010 As for creating a array for languages then break them up into files, (so you only load the required one) ie <?php $lang = array( "Hello" => "Hello", "bye" => "Good Bye" ); ?> <?php $lang = array( "Hello" => "Hallo", "bye" => "Auf Wiedersehen" ); ?> then you can include the desired language ie <?php $langID = "en"; include $langID.".php"; echo $lang['Hello']; ?> or <?php $langID = "de"; include $langID.".php"; echo $lang['Hello']; ?> Hope that help, as for the forum i agree with Mchl, that sqllite is a good option Quote Link to comment Share on other sites More sharing options...
Dillon Posted January 8, 2010 Author Share Posted January 8, 2010 Thanks for the quick replies! I just figured it would be a cool thing to mess around with. Since there arnt many flat file forum scripts... I am just messing around with it to learn, I dont want to make a full forum from it. How could I set up sqlite? Thanks! -Dillon Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.