alexenk Posted September 2, 2007 Share Posted September 2, 2007 Hey there I am fairly knew to coding PHP myself but I have been around coding for a long time so I get the gist of it. I have set up my site with a fully functioning login system and a page which is only viewable if you are logged in. Now what I need help with is this. I have 50 'sub sections' in a folder named into subfolders from 1-50. i.e they are labeled 1 2 3 etc. What I need is to have a button that when pressed selects a random one of those paths so that the user gets a different one every time. Please adivse on the best way to do this Many thanks Alex Quote Link to comment Share on other sites More sharing options...
alexenk Posted September 2, 2007 Author Share Posted September 2, 2007 I forgot to mention that as much code as possible would be helpful Quote Link to comment Share on other sites More sharing options...
Timma Posted September 2, 2007 Share Posted September 2, 2007 Hopefully this short, simple script will work. <?php echo " <a href='".rand(1,50)."/'> Click on this. </a> "; ?> Quote Link to comment Share on other sites More sharing options...
alexenk Posted September 2, 2007 Author Share Posted September 2, 2007 Thanks for the reply, I will test it out now Quote Link to comment Share on other sites More sharing options...
alexenk Posted September 2, 2007 Author Share Posted September 2, 2007 Thanks for that it works a treat, I just had to make one slight alteration, you had added an extra inverted comma by accident! Quote Link to comment 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.