Website Multi logo help
Posted: Wed Sep 22, 2010 5:14 pm
hi i was wonder is there a way to get multi logos on a webpage that change each time you refresh or go on a new page ?
Code: Select all
$randomlogo = rand(1,3);
if ($randomlogo == 1)
{
$logoname = "superlogo";
}
if ($randomlogo == 2)
{
$logoname = "goofylogo";
}
if ($randomlogo == 3)
{
$logoname = "basiclogo";
}
echo "<img = " . $logoname . ".png>";
Code: Select all
<?php
$image=(rand(0,5)+1);
echo "<img src=\"/path/to/logos/" . $image . ".jpg\""; ?>
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-GB" lang="en-GB">
<head>
<title>ºDBº Clan MW2</title>
<link rel="stylesheet" type="text/css" media="all" href="style.css" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/lib.js"></script>
</head>
<body>
<div id="header_img">
</div>
</div>
<div id="top_bar">
<div id="wrapper">
<ul id="header_bar_right">
<li>home</li>
<li><a href="members.html">Members</a></li>
<li><a href="#">Forums</a></li>
<li><a href="#">Apply</a></li>
<li><a href="#">Chat</a></li>
<li><a href="#">Squads</a></li>
</ul>
</div>
</ul>
</div>
<div id="left_col">
<div class="left_header">Latest News</div>
<div class="left_wrap">
<ul>
<li>
<div class="float_left"><b>----------------------</b></div>
<div class="float_right">----</div>
</li>
<li>
<div class="float_left"><b>----------------------</b></div>
<div class="float_right">----</div>
</li>
<li>
<div class="float_left"><b>----------------------</b></div>
<div class="float_right">----</div>
</li>
<li>
<div class="float_left"><b>----------------------</b></div>
<div class="float_right">----</div>
</li>
<li>
<div class="float_left"><b>----------------------</b></div>
<div class="float_right">----</div>
</li>
</ul>
</div>
<div class="left_header">Current Members</div>
<div class="members_wrap">
<div class="members_bar1">
<div class="members_class"><img src="images/presticon.jpg" alt=""/> ---</div>
<div class="members_class2"><img src="images/presticon.jpg" alt=""/> ---</div>
</div>
<div class="members_bar2">
<div class="members_class"><img src="images/presticon.jpg" alt=""/> ---</div>
<div class="members_class2"><img src="images/presticon.jpg" alt=""/> ---</div>
</div>
<div class="members_bar1">
<div class="members_class"><img src="images/presticon.jpg" alt=""/> ---</div>
<div class="members_class2"><img src="images/presticon.jpg" alt=""/> ---</div>
</div>
<div class="members_bar2">
<div class="members_class"><img src="images/presticon.jpg" alt=""/> ---</div>
<div class="members_class2"><img src="images/presticon.jpg" alt=""/> ---</div>
</div>
<div class="members_bar1">
<div class="members_class"><img src="images/presticon.jpg" alt=""/> ---</div>
<div class="members_class2"><img src="images/presticon.jpg" alt=""/> ---</div>
</div>
</div>
<div class="left_header">Servers</div>
<div class="left_wrap">
<ul>
<li>
<div class="float_left"><b>-----</b></div>
<div class="float_right">---</div>
</li>
<li>
<div class="float_left"><b>-----</b></div>
<div class="float_right">---</div>
</li>
<li>
<div class="float_left"><b>-----</b></div>
<div class="float_right">---</div>
</li>
<li>
<div class="float_left"><b>-----</b></div>
<div class="float_right">---</div>
</li>
<li>
<div class="float_left"><b>-----</b></div>
<div class="float_right">---</div>
</li>
<li>
<div class="float_left"><b>-----</b></div>
<div class="float_right">---</div>
</li>
</ul>
</div>
<div class="left_header">Useful Links</div>
<ul id="links_list">
<li><a href="http://www.codforums.com">CoDForums<br/>
<span>http://www.codforums.com</span></a></li>
<li class="links2"><a href="http://www.callofduty.com">Call of Duty HQ<br/>
<span>http://www.callofduty.com</span></a></li>
<li><a href="http://www.twitter.com/CoDForums">Twitter<br/>
<span>http://www.twitter.com/CoDForums</span></a></li>
<li class="links2"><a href="http://www.infinityward.com">Infinity Ward<br/>
<span>http://www.infinityward.com</span></a></li>
<li><a href="http://www.youtube.com/codforumsyt">Youtube<br/>
<span>http://www.youtube.com/codforumsyt</span></a></li>
</ul>
</div>
<div id="right_col">
<div class="post_wrapper"> <img src="images/post_a.jpg" alt="" />
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
<p>It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).</p>
</div>
<div class="post_wrapper"> <img src="images/post_b.jpg" alt="" />
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
</div>
<div id="sub_news">
<div class="sub_title"><span>First MW2 ClanMatch Results</span>
<div class="divider4"></div>
<span class="span_right">20/11/2009</span><a href="javascript:;"><img src="images/expand.gif" alt="1" /></a></div>
<div class="post_wrapper" style="display:none;" id="1"> <img src="images/post_a.jpg" alt="" />
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
</div>
<div class="sub_title"><span>MW2 is here! Initial thoughts</span>
<div class="divider4"></div>
<span class="span_right">16/11/2009</span><a href="javascript:;"><img src="images/expand.gif" alt="2" /></a></div>
<div class="post_wrapper" style="display:none;" id="2">
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
</div>
</div>
</div>
<div id="footer">
<div id="footer_left"> Copyright © <b>ºDBº MW2 Clan</b> 2010.<br/>
</div>
</body>
</html>
Code: Select all
<div id="header_img">
<?php
$image=(rand(0,5)+1);
echo "<img src=\"/path/to/logos/" . $image . ".jpg\""; ?>
</div>
Code: Select all
$image=(rand(0,7)+1);
Code: Select all
echo "<img src=\"graphics/page_elements/logos/" . $image . ".jpg\""; ?>
Code: Select all
$logos = array( 'logo1.jpg',
'logo2.jpg',
'logo3.jpg' );
Code: Select all
echo "<img src=\"" . $logos[ rand( 0, (count($logos)-1) ) ] . "\" alt=\"\" />";