Click to See Complete Forum and Search --> : Random welcome screen
DanteAlighieri
11-27-2003, 07:42 PM
Hi!
While I was surfing the web I ran into quite an interesting website, namely of Compagnie Financière Richemont S.A. (http://www.richemont.com/). I know there is some php involved. But I am not sure how it's done exactly. I would greatly appreciate it if someone could clarify its workings somewhat and tell me how I can achieve the same effect with my website (my server supports php).
Thanks.
Dante
essence
11-27-2003, 08:21 PM
Im not completely sure, but I think that company is using Java Script rather than PHP..
Here's a way u could do it in PHP though:
http://www.scriptarchive.com/rand_image.html
same thing, just make your welcome in an image format of your choice, and it will randomize em for ya.
-Peace
Originally posted by essence
Here's a way u could do it in PHP though:
http://www.scriptarchive.com/rand_image.html
Looks like Perl to me...
DanteAlighieri
11-28-2003, 04:41 AM
Thanks for your comments! :) I am quite sure we are dealing with .php though. Check this script:
<script type="text/javascript">
var myimages=new Array()
function preloadimages(){
for (i=0;i<preloadimages.arguments.length;i++){
myimages[i]=new Image()
myimages[i].src=preloadimages.arguments[i]
}
}
preloadimages("../images/home/copyright_2002_richemont_home<? echo $iRandom ?>_thebrands_on.gif","../images/home/copyright_2002_richemont_home<?echo $iRandom?>_investorinfo_on.gif","../images/home/copyright_2002_richemont_home<?echo $iRandom?>_companyprofile_on.gif","../images/home/copyright_2002_richemont_home<?echo $iRandom?>_careers_on.gif","../images/home/copyright_2002_richemont_home<?echo $iRandom?>_contact_on.gif","../images/copyright_2002_richemont_arrow_on.gif")
function goUrl(Selected) {
var newURL = Selected.options[Selected.selectedIndex].value ;
if (newURL!=" ") {
document.location.href = newURL;
}
}
</script>
These codes should do it. All I need know is some side server scripting. I am not completely sure how to write this though. Notice that tablecolor of the www.richemont.com site also differ each time. So I think a random image viewing script isn't enough.
Thanks.
Paul
Unless I am missing something, the variable $iRandom will always be undefined...