Jump to content


Photo

random image display


  • Please log in to reply
5 replies to this topic

#1 CyCloneKC

CyCloneKC
  • New Members
  • 42 posts

Posted 13 October 2003 - 02:31 PM

Anytime :p

#2 Destroyer

Destroyer

    Byte me

  • Members
  • 2,305 posts
  • Location:My back pocket
  • Projects:Having fun
  •  Just this guy, you know?

Posted 13 October 2003 - 01:40 AM

I was wondering how to make a single random image be displayed out of multiple choices (see "Ads" (above news) on Origin home page)

#3 CyCloneKC

CyCloneKC
  • New Members
  • 42 posts

Posted 13 October 2003 - 02:06 AM

Its not that hard.

<?
$URL1="http://URL1";
$URL2="http://URL2";
$URL3="http://URL3";

srand((double) microtime() * 1000000);
$random = rand(1,3);

if($random == 1)
@header ("Location: $URL1");
elseif ($random == 2)
@header ("Location: $URL2");
elseif ($random == 3)
@header ("Location: $URL3");

?>

Course, you can add more... but this mainly deals with premade stuff, I wouldnt know how to make random stuff inside of a random choice thing. I imagine it wouldnt be hard, but it would be somewhat time consuming.

#4 Destroyer

Destroyer

    Byte me

  • Members
  • 2,305 posts
  • Location:My back pocket
  • Projects:Having fun
  •  Just this guy, you know?

Posted 13 October 2003 - 12:30 PM

Thanks, CyCloneKC!

#5 the_kid

the_kid

    L337 Pwnerer of N00bs

  • Project Team
  • 1,734 posts
  • Location:La$ Vega$, NV
  • Projects:freelancing between what interests me
  •  + TRIPLEhelix

Posted 14 October 2003 - 02:51 AM

ooo, this could prove very useful, so I must thank you as well

Thanks,
The_kid

#6 Mastermind

Mastermind

    Server Technician

  • Undead
  • 7,014 posts
  • Location:Cambridge, MA
  • Projects:MasterNews 3
  •  The Man Behind the Curtain

Posted 14 October 2003 - 03:23 PM

Hmmm, maybe I can find a use for this as well.
:)
Posted Image

Well, when it comes to writing an expository essay about counter-insurgent tactics, I'm of the old school. First you tell them how you're going to kill them. Then you kill them. Then you tell them how you just killed them.

Too cute! | Server Status: If you can read this, it's up |




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users