10-04-2009, 07:09 PM
I was interested in doing this a few months ago and found that it was actually much easier then it seems!
Randomising the page titles is just a neat little "Easter egg", if you will" that simply changes the title of the page everytime it is loaded.
an example of this is:
www.bungie.net
where sometimes the title is simply bungie.net and other times it says things such as "xbox live and pizza 24/7" or "so we made this game called halo"
here is the code:
as we can see, the titles you want to add are in the 1st section of the code, and the second section of the code is what automates the changing of titles. you will have to adjust it to the amount of titles you have.
eg. if you have 10 titles your code will look like this (in the 2nd section)
instead of:
simple isn't it!
By the way, cameronsprivates.com is my proxy. Just incase you were wondering!
Randomising the page titles is just a neat little "Easter egg", if you will" that simply changes the title of the page everytime it is loaded.
an example of this is:
www.bungie.net
where sometimes the title is simply bungie.net and other times it says things such as "xbox live and pizza 24/7" or "so we made this game called halo"
here is the code:
PHP Code:
<?php
site name[1] = "Cameron's Privates, now with crabs!"
site name [2] = "Cameron's Privates, dont you love them?";
site name[3] = "Cameron's Privates, I've got wood... in my fire!";
site name[4] = "Cameron's Privates";
$random_select = rand(1, 4);
echo $title[$random_select];
?>
as we can see, the titles you want to add are in the 1st section of the code, and the second section of the code is what automates the changing of titles. you will have to adjust it to the amount of titles you have.
eg. if you have 10 titles your code will look like this (in the 2nd section)
PHP Code:
$random_select = rand(1, 10);
echo $title[$random_select];
instead of:
PHP Code:
$random_select = rand(1, 4);
echo $title[$random_select];
simple isn't it!
By the way, cameronsprivates.com is my proxy. Just incase you were wondering!