Jocka Posted September 20, 2010 Share Posted September 20, 2010 I haven't really messed with PHP in like 2 years. Just little fixes on old scripts every now and then. I've been kind of in an argument with myself the past couple of days while writing a script. The thing is I only have around 3 or 4 sets of information I need. Such as: option1: information for option 1 option2: information for option 2 option3: information for option 3 etc.. NOW, at first I was doing this all in a text file. This information doesn't necessarily need to be private but i also don't want people to know what file needs to be edited right off the bat. I don't see any reason at all for using databases here, I'd much rather stick to files. I'm thinking it may be best to store this is strings in a seperate PHP file and include it? Then if I need to edit it, I can simply write a new file. Any suggestions? Quote Link to comment Share on other sites More sharing options...
Jocka Posted September 21, 2010 Author Share Posted September 21, 2010 As it goes right now I have 2 basic files: ((edited, sorry my original file was ridiculous)) THE FILE THAT READS/WRITES THE INFO <?php // $ = $ $content = "<?php $info1 = \"new info\"; $info2 = \"new info 2\"; $info3 = \"new info 3\"; ?>"; $handle = fopen('info_holder.php', 'w+'); fwrite($handle, html_entity_decode($content)); fclose($handle); include ('info_holder.php'); echo $info1; ?> THE FILE THAT HOLDS THE INFO <?php $info1 = "info number 1"; $info2 = "info number 2"; $info3 = "info number 3"; ?> Any other ideas for this small ideas on a better way would be nice. Otherwise I'll stick with this little script idea for now. 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.