War Room

Go Back   WarriorForum - Internet Marketing Forums > Warrior Support Forums > Website Design

Featured Warrior Special Offer...
"Members Of The *War Room* Discover Secrets To Immediate Success!"
Reply
 
LinkBack Thread Tools
Old 11-04-2009, 02:53 PM   #1
Warrior Member
 
Join Date: Aug 2009
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default Suggestions for a free PHP Rotation Script

Hi

I would like to know if anyone can suggest a php script that will allow me to rotare articles on my web page. For example I have 5 articles and I would like to show a different article to each new visitor on one page.

Thanks

One4u Free PHP Web Hosting. We offer 250mb of quality webspace, 6GB of Bandwidth, PHP and Mysql, FTP Account and much more Click Here To Create Your Free Hosting Account
webmasteruk is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-04-2009, 03:07 PM   #2
Active Warrior
 
jwlnewsome's Avatar
 
Join Date: Nov 2009
Location: UK
Posts: 40
Thanks: 0
Thanked 5 Times in 5 Posts
Default Re: Suggestions for a free PHP Rotation Script

This is a quick one, normally the array is links for redirects
<?php
//array of the articles text or reference to them from a database
$arr = array(
'one','two','three','four','five')
$rand = rand(0,4);
$article = $arr[$rand];
echo $article
?>

if you want a proper script give me more details. ie where you store the articles. wont take long to knock one up

Last edited by jwlnewsome; 11-04-2009 at 03:09 PM. Reason: adding last line
jwlnewsome is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-04-2009, 03:36 PM   #3
Warrior Member
 
Join Date: Aug 2009
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default Re: Suggestions for a free PHP Rotation Script

Thx jwlnewsome

I have just been trying that code snippet and it does not work or atleast I cannot make it work.

If there is a code snippet that can be put on web pages to allow random articles from one folder asigned to that web page to show all the articles in that folder randomly when a vistior visits.

So each page will have its own folder filled with articles to be shown randomly on that page.

One4u Free PHP Web Hosting. We offer 250mb of quality webspace, 6GB of Bandwidth, PHP and Mysql, FTP Account and much more Click Here To Create Your Free Hosting Account
webmasteruk is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-04-2009, 04:14 PM   #4
Advanced Warrior
War Room Member
 
mywebwork's Avatar
 
Join Date: Sep 2008
Location: Honolulu, Hawaii, USA (Currently in Montreal Canada)
Posts: 813
Blog Entries: 1
Thanks: 138
Thanked 217 Times in 146 Posts
Social Networking View Member's Twitter Profile 
Contact Info
Send a message via Skype™ to mywebwork
Default Re: Suggestions for a free PHP Rotation Script

Actually the code jwlnewsome posted is essentially what you need, perhaps you left off the closing semicolons on the array and echo lines like jwlnewsome did in their post. Essentially you're defining and array of articles and using a random number generator to make a selection in the array.

Check your code for syntax errors and try again!

Bill
mywebwork is online now  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-04-2009, 05:33 PM   #5
Warrior Member
War Room Member
 
Join Date: Apr 2009
Posts: 28
Thanks: 2
Thanked 1 Time in 1 Post
Default Re: Suggestions for a free PHP Rotation Script

That was a nice bit of base code Bill - the only other option that I would have considered would be adding a dynamic database field that updates at pageload - plus a table containing the banner pics of course...
da1fitz is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-04-2009, 06:14 PM   #6
Advanced Warrior
War Room Member
 
mywebwork's Avatar
 
Join Date: Sep 2008
Location: Honolulu, Hawaii, USA (Currently in Montreal Canada)
Posts: 813
Blog Entries: 1
Thanks: 138
Thanked 217 Times in 146 Posts
Social Networking View Member's Twitter Profile 
Contact Info
Send a message via Skype™ to mywebwork
Default Re: Suggestions for a free PHP Rotation Script

Actually da1fitz the code was posted by jwlnewsome, I was just commenting on it.

This link may be useful to the OP, there are several scripts to choose from here:

PHP Random Text | Randomizing Scripts & Programs | Hot Scripts

Bill
mywebwork is online now  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-05-2009, 10:48 AM   #7
Warrior Member
 
Join Date: Aug 2009
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default Re: Suggestions for a free PHP Rotation Script

Thanks all for your help I have managed to get something working with the code that jwlnewsome posted. It took a little reasearch on google and a bit of cursing but it is now working the way I wanted it to work

Again thans all for your help.

One4u Free PHP Web Hosting. We offer 250mb of quality webspace, 6GB of Bandwidth, PHP and Mysql, FTP Account and much more Click Here To Create Your Free Hosting Account
webmasteruk is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

  WarriorForum - Internet Marketing Forums > Warrior Support Forums > Website Design

Tags
free, php, rotation, script, suggestions

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -6. The time now is 09:08 PM.