after you place my script, just change the html extension to .php
if stay in .html, server will not read the <?php tags :P
after you place my script, just change the html extension to .php
if stay in .html, server will not read the <?php tags :P
Regards,
Raphael DDL
Designing Solutions for You
*Web Design;
*Coding;
Free Downloads;
and all related Stuff.
My Tutorials:
| Multi-Language Websites | Rotative Banners |
| Bookmark Script for All Browsers |
| PHP Switching/Including Content|
|
.
JUST AN ADD-ON:
If you want to add this to everypage of your website, instead of copying/pasting the code on every page, just do a new .php page and paste the code there. Add all things you want and save. NO NEED to put html tags or anything, just put the <?php and the codes, close with ?> and its done.
Then, in the place you want to add the code in the pages, put:
Then, everytime that you need to change the code, instead of changing in all files, just change the php with the code.Code:<?php @include("NAME OF THE PHP FILE WITH CODES.php"); ?>
AND, the @ before the include is, to when the file you including does not exist, instead of givin that PHP ERROR: include in line xx error etcs and show everyone your acc name (root/XXXX/public_html/etc) , just show nothing. ^^
Regards,
Raphael DDL
Designing Solutions for You
*Web Design;
*Coding;
Free Downloads;
and all related Stuff.
My Tutorials:
| Multi-Language Websites | Rotative Banners |
| Bookmark Script for All Browsers |
| PHP Switching/Including Content|
|
Got bored, don't want to do my homework... Here's a compact version:
Using just one main array allows the related data to be closer so it isn't so spread out.PHP Code://Store data in multidimensional array with associative indexes
$banner=array(
array(
'img'=>'http://ddl.exofire.net/images/banner2.gif',
'url'=>'www.google.com.br',
'alt'=>'its google lol'),
array(
'img'=>'http://ddl.exofire.net/images/468x80_banner.gif',
'url'=>'ddl.exofire.net',
'alt'=>'my website')
);
//Generate random index
$index=rand(0,count($banner)-1);
//Select and reference current banner
$cur=&$banner[$index];
//Generate output
$out="<a href='$cur[url]'><img src='$cur[img]' alt='$cur[alt]'></a>";
I didn't test it, but it ought to work. Be sure you do something with $out.
Last edited by deadimp; 11-14-2007 at 11:58 PM.
Aside from adding border='0' to the image and inserting a title tag into the href, that pretty much sums it up
YOu could still use shuffle if you like though.
Easiest 70 points you'll make on x10
Feel free to add my reputation by clicking on theif you found my post helpful to you :P
If I am not responding to your PMs, that means I am ignoring you. Take a hint.
09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
Expect Amazing!
FIFA World Cup 2022 comes home to the State of Qatar