I'm sorry if this is covered in a previous thread, but I couldn't see it while I skimmed through.
I am brand new to self developed sites (ie: I have never had to code my self before, using only the likes of wordpress and joomla!).
I am desiging a site for a church that requires a daily Bible reading schedule to be put up. I have a .txt file that lists the applicable daily readings, with each day on a separate line, but don't know how to code PHP to make it happen.
Use an XML file to hold your data, rather than a text file. You have various options from that point on. You can have your page look for an XML file with a date on it, like: "dailyReading20120401.xml", if the readings differ from week to week. If the daily readings are fixed then the xml file could contain a Monday, Friday, Sunday section.
If you wish to send the daily readings with the page you can use php to access the XML file and read the appropriate section in an ordered way.
The text will be displayed in a div box. All I need it to do is select the correct line of text to display according to the day of the week. I have a random text selector (in PHP) that will select a line of text from a .txt file to display in a similar fashion, but for this particular item I obviously want it to take it in the correct order, not random.
I am definatley open to advise, so if an xml file is a better option, I will run with that- but the scripting to get the correct line is where I am now stuck. If date is a bad option (I don't need year, just month and day) I can number each line 1-365 if that would work better?
I have been looking at this, but as I said earlier, I am a total newbie at this.
What is the best way for me to include this script in the site. Do I put that script directly into the <div> tag? or reference to it as a < script > tag?
I thank you for the education. I hope to be able to pass on the goodwill when I have learned some!
Bookmarks