PDA

View Full Version : creating content rotators


Fred
01-19-2004, 06:36 PM
I would like to add content rotators to my webpages, so that my meta description, keywords, title, and text on the page will change to something different, from a big list of keyword phrases, everytime the browser is refreshed, as seen in this example: http://www.wileyclark.com. When you refresh this page, notice how the title changes everytime.

I'm not having any luck finding a content rotator script that accomplishes this, or any helpful tutorials on how to set one up. I checked all the free script sites, and did many google searches. To be honest, I don't even know if this is supposed to use SSI, a special php script or whatever.

I found this tutorial site on asp http://www.w3schools.com/asp/showasp.asp?filename=demo_contentrotator

but this has been of little help. I attempted an experimental page with their example, but it didn't work.
Fred

glenngv
01-20-2004, 05:57 AM
Do you have any access to a server-side language (PHP, ASP, JSP, etc)? I supposed you have ASP since you post this in this forum. But you said the example from w3schools didn't work.

Fred
01-20-2004, 03:25 PM
It turned out I can't use asp under Linux, but however I can use PHP. I found this simple php phrase rotator script:

http://www.t6m.com/software/phraserotator/

but could not get it to work.

Upon testing, the php is working because <? include "scripts/phraserotator.php" ?> did disappear from the page source exactly as it should, but none of the phrase text data is getting written to the page, leaving a blank page. Trying variations of the file path didn't help.

I successfully enabled php to work on html pages via .htaccess, but either way, .php, or .html page, nothing is appearing on the page.

Here is the actual script. It's very short.

<?php
/* ................................
* imageRotator v0.1 beta
* Last Update October 27
* josesilva@t6m.com
*/


// ...........(CONFIGURATIONS).....

$path = ".";
$path_to_words_files = "phrases.txt";

// .......DO NOT EDIT BELOW .......

$global_path = $path.$path_to_words_files;

if(file_exists($global_path))
{
$lines = file($global_path);
}

mt_srand( (double) microtime ()* 1000000 );
$tmp = $lines[ mt_rand( 0, sizeOf($lines)-1 ) ];


echo $tmp;


?>

Fred

glenngv
01-21-2004, 04:14 AM
This thread must be moved to PHP forum (http://www.codingforums.com/forumdisplay.php?s=&forumid=6) so you can get more help.

Fred
01-21-2004, 05:27 AM
Glenn,
Good idea. I agree, this should be moved to the php forum. Please go ahead and move it over there. I have a bunch more php questions.
Fred

glenngv
01-21-2004, 06:11 AM
Only moderators can move threads.

Fred
01-24-2004, 01:35 AM
Success, got it working.

http://www.repair-bad-credit.org

http://www.cyberserious.com

Fred