Jump to content


Photo

Include_once anchor or section?


  • Please log in to reply
4 replies to this topic

#1 tmsos

tmsos
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 31 July 2006 - 02:24 AM

Hello,
I want to display daily text on certain sections of my website. Currently I just have an html file for each day of the month - I add the text to each file and then have it display the text on my site based on the day of the month  <?php include_once("folder/files/".date("md").".html");  ?>

My question is, is there a way where I could just have one html file with 31 paragraphs of information (as opposed to 31 html files). Then add an anchor or number each of them as a table (not really sure how to do it) - but anyway I was wondering if there would be any way to include a paragraph from the html file based on what day it is, or just go in the order of 1 to 31.

So if it were July 30th, the php would pull the 30th paragraph or section from the one main html file, and display only that certain sections text.

#2 Drumminxx

Drumminxx
  • Members
  • PipPipPip
  • Advanced Member
  • 92 posts
  • LocationUSA

Posted 31 July 2006 - 02:30 AM

yes you could write a script to do what you want or you could use a database, actually there are a number of ways to do this.

Have you tried to write something yourself?
:: gucci.com ::
:: blockbuster.com ::

--------------------

#3 tmsos

tmsos
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 31 July 2006 - 02:38 AM

I tried awhile back, but had no luck. - Basically I am looking to get around updating pages everyday for every month

If I could just paste 365 paragraphs in one file, and have them display in order or based on what day it was, that would be great. I would settle for 12 files with 31 (30, 29, 28) paragraphs.

I do have a Mysql database too, if you have any ideas there.

#4 Drumminxx

Drumminxx
  • Members
  • PipPipPip
  • Advanced Member
  • 92 posts
  • LocationUSA

Posted 31 July 2006 - 02:42 AM

yea just use a database and then you would have a date field along with others content,etc..

then just write a script that would select the content based on what the date is
:: gucci.com ::
:: blockbuster.com ::

--------------------

#5 tmsos

tmsos
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 31 July 2006 - 02:49 AM

If possible I was looking to have the information pulled from a text or html file. - A lot of the hassle in displaying daily content is having to paste the content in an individual file. I seems like it would be a bigger hassle to add this information into a database. Especially if the content changes or needs to be updated.

I will look at the database thing more, but if anybody has any ideas on how to pull out a paragraph from one file, as I said either in order or based on what day of the month it was, let me know.

-It would be a lot easier to manage 12 files (for each month of the year) or even one large file with 365 paragraphs, as opposed to 365 individual files.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users