big-dog1965 Posted March 29, 2009 Share Posted March 29, 2009 Is there a way to display a differant page per month in <div id="contentarea"></div> I tried Monthly iframe content II from www.dynamicdrive.com, but it didnt work I believe the iframe thing is not working with the div I want it to display the pages in. Ive looked around the net but havent found anything that allows me to setup 12 pages i.e. Jan.htm or php, Feb.htm or php, March.htm or php........ and display the page according to month. Im using this to display a page now without having to click a link or anything. <script type="text/javascript"> // Auto Loads Splash ajaxpage('splash/mar.htm', 'contentarea') </script> Its part of anylinkcss I cant seem to get a responce or help from dynamicdrive so I turn to you all for the answer. Quote Link to comment https://forums.phpfreaks.com/topic/151581-solved-display-a-differant-splash-page-each-month-in-a-div/ Share on other sites More sharing options...
redarrow Posted March 29, 2009 Share Posted March 29, 2009 edited had to add a 0 to the array key to match the dates so sorry.... what wrong doing it this way? <?php $date=date("m"); $array=array("01"=>"redarrow","02"=>"php","03"=>"myslq","04"=>"html","05"=>"css"); foreach($array as $key=>$val){ switch($date){ case "$key": echo $val; break; } } ?> or <?php $date=date("m"); $array=array("01"=>"spalsn_name1.php","02"=>"splach_name2.php","03"=>"spalsh_name3.php","04"=>"splash_name4.php","05"=>"splash_name5.php"); foreach($array as $key=>$val){ switch($date){ case "$key": $value=file_get_contents("http://www.what_ever.com/$value"); echo $value; break; } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/151581-solved-display-a-differant-splash-page-each-month-in-a-div/#findComment-796123 Share on other sites More sharing options...
big-dog1965 Posted March 29, 2009 Author Share Posted March 29, 2009 I dont unstand what your telling me do I substut what you have there for what I do for the link or do I write a php file with your code in it and refer my current link ajaxpage('splash/php with your code in it, 'contentarea') Quote Link to comment https://forums.phpfreaks.com/topic/151581-solved-display-a-differant-splash-page-each-month-in-a-div/#findComment-796127 Share on other sites More sharing options...
redarrow Posted March 29, 2009 Share Posted March 29, 2009 it a php example to change information monthly. Use a array, and date function, and a switch, to get the result every month. don't no nothing about ajax or your design set up, just a simple example to play with. it might help it might not sorry. Quote Link to comment https://forums.phpfreaks.com/topic/151581-solved-display-a-differant-splash-page-each-month-in-a-div/#findComment-796131 Share on other sites More sharing options...
big-dog1965 Posted March 29, 2009 Author Share Posted March 29, 2009 The second excample got me going Thanks Quote Link to comment https://forums.phpfreaks.com/topic/151581-solved-display-a-differant-splash-page-each-month-in-a-div/#findComment-796155 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.