| PHP Random Image - Script Random Image | | Print | |
PHP Random Image - Random Banner
This code can use for Banner, or Style website.
Code:
Example:
<html>
<HEAD>
<link rel="stylesheet" href="excess.css" type="text/css" />
</HEAD>
<body leftmargin="0" topmargin="0">
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
<tr>
<td align="center">
<?php
$file ="banner.txt"; /* Where the file banner code? */
$x = file("$file");
$y = rand(0, sizeof($x)-1);
echo $x[$y];
?>
</tr>
</td>
</table>
</body>
</html>
Follow step by step how to make Random Banner!
1. Creat code bellow to random.php
<html>
<HEAD>
<link rel="stylesheet" href="excess.css" type="text/css" />
</HEAD>
<body leftmargin="0" topmargin="0">
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
<tr>
<td align="center">
<?php
$file ="banner.txt"; /* Where the file banner code? */
$x = file("$file");
$y = rand(0, sizeof($x)-1);
echo $x[$y];
?>
</tr>
</td>
</table>
</body>
</html>
2. Create code bellow to excess.css
body {
color: #000000;
font-family: "Times New Roman", Times, serif;
font-size: 11pt;
}
a {
color: #000000;
text-decoration: none;
}
a:visited {
color: #0000FF;
}
a:hover {
color: #C0C0C0;
}
3. Create code bellow to banner.txt
<embed allowScriptAccess="never" allowNetworking="internal"
src="http://www.g-excess.com/partner/swf/ikan.swf" quality=high
wmode=Transparent width="200" height="200"></embed>
<a href="http://wwww.g-excess.com/" target="_blank"><img
src="http://www.google.co.id/logos/balloon08.gif" width="200"
height="112"></a>
<a href="http://www.g-excess.com/" target="_blank"><img
src="http://kahnews.net/Firefox-banner.png" width="180"
height="60"></a>
<a href="http://www.g-excess.com/" target="_blank"><img
src="http://toastytech.com/good/ffbanner.png" width="180"
height="60"></a>
4. Save with same folder and upload to your webs hosting.
5. Try access it
PHP Random Image - Random Banner
| Users' Comments (0) |
|
No comment posted




