I have five files, namely index.php and first.php .. fourth.php.
first.php through fourth.php represent an annual calendar divided into 4 quarters (3 months per file). Now, I just need to display within the index page the current quarter. For example, since it’s August, my index should display third.php, which contains July, August and September. In short, I need to make my index page dynamic.
This is my current code, which is obviously static:
if(!isset($_GET['quarter']) && !isset($_GET['year'])){
include ('/thirdq2012.php');
}
Also, how would I test this?
EDIT: problem fixed! i have another question, on top of every page, i have a drop down year button, which switches from 2011, 2012, 2013. my next problem is how to display the specific quarter for the selected year without creating multiple files? example quarter 1(january, february, march) of year 2011 contains data and other values that the user input, but quarter 1 of year 2012 doesnt contain anything. how will i switch on from there?
1 Answer