/    Sign up×
Community /Pin to ProfileBookmark

Random welcome screen

Hi!

While I was surfing the web I ran into quite an interesting website, namely of Compagnie Financière Richemont S.A. ([url]http://www.richemont.com/[/url]). 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

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@essenceNov 28.2003 — 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
Copy linkTweet thisAlerts:
@pyroNov 28.2003 — [i]Originally posted by essence [/i]

[B]Here's a way u could do it in PHP though:

http://www.scriptarchive.com/rand_image.html[/B]
[/QUOTE]

Looks like Perl to me...
Copy linkTweet thisAlerts:
@DanteAlighieriauthorNov 28.2003 — 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
Copy linkTweet thisAlerts:
@pyroNov 28.2003 — Unless I am missing something, the variable $iRandom will always be undefined...
×

Success!

Help @DanteAlighieri spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...