Random Html Generator...

Anybody know if the Random HTML Generator provided via CPanel works w/ imagemaps?<br /><br />I wanted to have a random header appear each time the page was refreshed. The coordinates for the hotspots are the same on every image so the imagemap reference doesn't change.<br /><br />Thanks<br /><br />DAve<!--content-->
As I understand it the Random HTML script<br />allows you to insert random pieces of text into your web page<br />such as quotes, I believe you can use a line of html to display an image but not an image map.<br /><br />there must be a javascript or php code to do this.<br />other wise maybe a php script to include random code (image map and code)<br /><br />google may help to find something like<br />*http://www.alistapart.com/articles/randomizer/<br />or something similar<br /><br />or a random map location in the image map html.<br />Sorry thats all I could find.<!--content-->
I don't know if it specifically works about the random html generator, but it can be easily done in php with ease.. <br /><br />1. rename whatever file this is happening on to have a .php extension (i.e. index.html -> index.php)<br /><br />2. put this where you want the image map to appear:<br /><br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--><?<br />include ('randommap.php');<br />?><!--c2--></div><!--ec2--><br /><br />3. create a text file called randommap.php<br /><br />4. make the text of the file this:<br /><br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--><?<br /><br />$imgmap = rand(1,3);<br /><br />if($imgmap == 1)<br />{<br />?><br /><br />//the code of your first map here<br /><img src=http://www.totalchoicehosting.com/forums/lofiversion/index.php/"http://lightsphere.com/dev/ismaps/cube.gif" alt="" usemap="#cube"><br /><map name="cube"><br /><area shape="rect" coords="1,1,37,37" href=http://www.totalchoicehosting.com/forums/lofiversion/index.php/"http://www.google.com"><br /><area shape="rect" coords="37,1,74,37" href=http://www.totalchoicehosting.com/forums/lofiversion/index.php/"http://www.yahoo.com"><br /><area shape="rect" coords="1,37,37,74" href=http://www.totalchoicehosting.com/forums/lofiversion/index.php/"http://www.nfl.com"><br /><area shape="rect" coords="37,37,74,74" href=http://www.totalchoicehosting.com/forums/lofiversion/index.php/"http://www.totalchoicehosting.com"><br /></map><br /><br /><?<br />}<br /><br />if($imgmap == 2)<br />{<br />?><br /><br />//the code of your second map here<br /><br /><?<br />}<br /><br />if($imgmap == 3)<br />{<br />?><br /><br />//the code to your third map here<br /><br /><?<br />}<br /><br />?><!--c2--></div><!--ec2--><br /><br />5. upload it to the same directory... now you could have the above in the file you want this map to appear, but it may get a little messy to look at which is why i would put it in the randommap.php file<br /><br /><br />6. if this map appears on several pages, all you have to do is put the first snippet (the include('randommap.php') snippet) on any page at the place you want the map to appear. <br /><br />7. the rand(1,3) line can be changed so you can add as many maps as you have. this example would have three...<!--content-->
Very cool Thumbs Up<!--content-->
 
Back
Top