Change *.html based on month of the year

Hi!

I have 12 files from januari.html to december.html, I have another file that’s called months.html.
When going to months.html link from the index.php I would like to have something to check which is the current month and go to that file to show me the current month.

Is something like this possible. I’m not a big expert in javascript or jquery, to access files in a directory.

Any help would be appriciated.

What is the context or use case scenario? To overly simplify your question, this is like deciding how to change or set a sites copyright date. It’s something that should be done once a year each year not recalculated for every single site visitor. On the server, I could use a command line utility like cron to set an automated job once a year. Will cron use other unix utility programs or a PHP script to do this, It’s up to you. Seasonal rotation of data files or resource files should happen once on the server and then cached or cause an edit either directly or by inline templates.

Not with JavaScript, you can’t (and don’t) want to access files. You have a PHP application, I don’t understand why you want to use JS to do this: check what the month is and return the correct HTML when a person hits the front end, unless I’m misunderstanding what you’re doing you shouldn’t need anything more than switch whatever PHP template you want to render based on whatever month it is.