jjwinter Posted August 10, 2009 Share Posted August 10, 2009 I am guessing this is much easier then I am making this. I am trying to generate a random number so I can load a random page layout by using include. This is the code that doesn't work (obviously) but I think it may help with understanding what I am going for <?php include (TEMPLATEPATH . "/random-layout/single<?php echo rand(1, 3); ?>.php"); ?> Am I over simplifying a complex issue or is there a easy way to get something like this too work? Quote Link to comment https://forums.phpfreaks.com/topic/169609-solved-generate-rand-number-in-include-templatepath/ Share on other sites More sharing options...
Daniel0 Posted August 10, 2009 Share Posted August 10, 2009 <?php include (TEMPLATEPATH . "/random-layout/single" . rand(1, 3) . ".php"); ?> Quote Link to comment https://forums.phpfreaks.com/topic/169609-solved-generate-rand-number-in-include-templatepath/#findComment-894832 Share on other sites More sharing options...
jjwinter Posted August 10, 2009 Author Share Posted August 10, 2009 Perfect, works great. Simple answer, but to someone who is learning, it really opens up more ideas for me to work with. Thanks for helping! Quote Link to comment https://forums.phpfreaks.com/topic/169609-solved-generate-rand-number-in-include-templatepath/#findComment-894843 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.