Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Looking for a PHP rotator script!
Old 12-06-2010, 04:05 AM Looking for a PHP rotator script!
zomex's Avatar
Ultra Talker

Posts: 308
Name: Jack
Trades: 0
Hello everyone,

I'm looking for a PHP rotator script for displaying text on a page that changes on each refresh.

My aim is to use it to display 1 testimonial that changes each time the page is refreshed.

I would like to thank you in advance for any recommendations!

Thanks,
Jack
__________________

Please login or register to view this content. Registration is FREE
- Hosting over 200 websites!


Please login or register to view this content. Registration is FREE
from just $3.99/month

Please login or register to view this content. Registration is FREE
- 20% Lifetime Commissions!
Please login or register to view this content. Registration is FREE
zomex is offline
Reply With Quote
View Public Profile Visit zomex's homepage!
 
 
Register now for full access!
Old 12-06-2010, 01:07 PM Re: Looking for a PHP rotator script!
zomex's Avatar
Ultra Talker

Posts: 308
Name: Jack
Trades: 0
Does anyone know of a script?

Thanks!
__________________

Please login or register to view this content. Registration is FREE
- Hosting over 200 websites!


Please login or register to view this content. Registration is FREE
from just $3.99/month

Please login or register to view this content. Registration is FREE
- 20% Lifetime Commissions!
Please login or register to view this content. Registration is FREE
zomex is offline
Reply With Quote
View Public Profile Visit zomex's homepage!
 
Old 12-06-2010, 05:54 PM Re: Looking for a PHP rotator script!
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
http://www.google.com/search?hl=&q=php+text+rotator
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 12-07-2010, 06:18 AM Re: Looking for a PHP rotator script!
Gakoyu Ojima's Avatar
Skilled Talker

Posts: 59
Location: Netherlands.
Trades: 0
Google is useful, but if that would be used all the time, there wouldn't be any use of a forum, right?

That said, you'd need to do two things: randomize it, and actually insert input every time. A good way to do that would be to use an array. For randomizing, we'll use rand(). Let's assume you want five text bits randomized. We'll need to define both the minimum, and maximum as parameters for rand().

PHP Code:
<?php
      $randRotate 
rand(0,4);

      
$text[0] = 'Your text 1';
      
$text[1] = 'Your text 2';
      
$text[2] = 'Your text 3';
      
$text[3] = 'Your text 4';
      
$text[4] = 'Your text 5';
?>
You'll want to echo it as output on your page. Put it between PHP tags where you want it exactly. Make sure that the extension is .php.
PHP Code:
<?php
      
echo($text[$randRotate]);
?>
__________________
$gocore = new gakoyucore();
$con = mysql_connect($gocore->server, $gocore->username, $gocore->password) or die(mysql_error());
Gakoyu Ojima is offline
Reply With Quote
View Public Profile
 
Old 12-07-2010, 06:31 AM Re: Looking for a PHP rotator script!
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Forums exist for discussion of PROBLEMS or developments.
Forums are NOT tutorials.
Forums are NOT a repository of scripts.
Forums are NOT a method for lazy people to locate what they want

IF you ask a question at a forum and show that you have gone some way to helping yourself find a resolution you will get a much better response than you would by asking a question (accompanied by several signature links of course) to which the answer is EASILY FOUND by other means.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 12-09-2010, 07:24 AM Re: Looking for a PHP rotator script!
Extreme Talker

Posts: 156
Trades: 0
This is what Openx formerly Phpadsnew does well
dagaul101 is offline
Reply With Quote
View Public Profile
 
Old 12-09-2010, 07:42 AM Re: Looking for a PHP rotator script!
zomex's Avatar
Ultra Talker

Posts: 308
Name: Jack
Trades: 0
Gakoyu Ojima

Thank you very much for your script (+rep)! This is exactly what I'm after. I do have 1 question. Is it possible to have the code in a external file and then call it on multiple pages using echo?

^ Sorry I'm new to PHP If it's not possible I'll still be using this script though

I'd like to make you a small donation via PayPal for your efforts. If you can send me your PayPal email that will be great.

chrishirst


You're jumping to assumptions very quickly. I have been researching for a script to use already. The old script I was using selected a line at random from a txt file but allot of the time it would show nothing
The problem is that due to my lack of PHP knowledge it's risky to use such scripts which is why I asked for recommendations here.

dagaul101

Thanks for the recommendation. It looks fantastic but it's a bit too bulky/feature rich for my plans.

Thanks!
Jack
__________________

Please login or register to view this content. Registration is FREE
- Hosting over 200 websites!


Please login or register to view this content. Registration is FREE
from just $3.99/month

Please login or register to view this content. Registration is FREE
- 20% Lifetime Commissions!
Please login or register to view this content. Registration is FREE

Last edited by zomex; 12-09-2010 at 07:45 AM..
zomex is offline
Reply With Quote
View Public Profile Visit zomex's homepage!
 
Old 12-09-2010, 07:46 AM Re: Looking for a PHP rotator script!
zomex's Avatar
Ultra Talker

Posts: 308
Name: Jack
Trades: 0
EDIT: It just occurred to me that I could probably use a PHP include for this? The only PHP I currently know is includes. I use them for just about everything!

I'm going to try this now and report back soon
__________________

Please login or register to view this content. Registration is FREE
- Hosting over 200 websites!


Please login or register to view this content. Registration is FREE
from just $3.99/month

Please login or register to view this content. Registration is FREE
- 20% Lifetime Commissions!
Please login or register to view this content. Registration is FREE
zomex is offline
Reply With Quote
View Public Profile Visit zomex's homepage!
 
Old 12-09-2010, 07:55 AM Re: Looking for a PHP rotator script!
zomex's Avatar
Ultra Talker

Posts: 308
Name: Jack
Trades: 0
It worked perfectly I'll look forward to your PM.

Thanks!
Jack
__________________

Please login or register to view this content. Registration is FREE
- Hosting over 200 websites!


Please login or register to view this content. Registration is FREE
from just $3.99/month

Please login or register to view this content. Registration is FREE
- 20% Lifetime Commissions!
Please login or register to view this content. Registration is FREE
zomex is offline
Reply With Quote
View Public Profile Visit zomex's homepage!
 
Old 12-12-2010, 07:05 PM Re: Looking for a PHP rotator script!
Gakoyu Ojima's Avatar
Skilled Talker

Posts: 59
Location: Netherlands.
Trades: 0
Quote:
Originally Posted by zomex View Post
Gakoyu Ojima

Thank you very much for your script (+rep)! This is exactly what I'm after. I do have 1 question. Is it possible to have the code in a external file and then call it on multiple pages using echo?

^ Sorry I'm new to PHP If it's not possible I'll still be using this script though

I'd like to make you a small donation via PayPal for your efforts. If you can send me your PayPal email that will be great.
It should be possible to include the file and call the array from your, let's say, index.php. But I see you fixed it in the meantime already.

And thanks for the offer to donate, but unfortunately, PayPal is not an option for me. Thanks anyway, and you're welcome!
__________________
$gocore = new gakoyucore();
$con = mysql_connect($gocore->server, $gocore->username, $gocore->password) or die(mysql_error());
Gakoyu Ojima is offline
Reply With Quote
View Public Profile
 
Old 12-13-2010, 05:32 AM Re: Looking for a PHP rotator script!
zomex's Avatar
Ultra Talker

Posts: 308
Name: Jack
Trades: 0
Quote:
Originally Posted by Gakoyu Ojima View Post
It should be possible to include the file and call the array from your, let's say, index.php. But I see you fixed it in the meantime already.

And thanks for the offer to donate, but unfortunately, PayPal is not an option for me. Thanks anyway, and you're welcome!
Thanks Gakoyu once again. That's right, the include worked perfectly and I'm now using it for the testimonials on my homepage (about half way down).

It's a shame about the donation. Anyway, I wish you the best of luck in the future! If you ever need free hosting for a year let me know.

Jack
__________________

Please login or register to view this content. Registration is FREE
- Hosting over 200 websites!


Please login or register to view this content. Registration is FREE
from just $3.99/month

Please login or register to view this content. Registration is FREE
- 20% Lifetime Commissions!
Please login or register to view this content. Registration is FREE
zomex is offline
Reply With Quote
View Public Profile Visit zomex's homepage!
 
Reply     « Reply to Looking for a PHP rotator script!
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.39098 seconds with 12 queries