Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
random picture display
Old 02-12-2004, 09:56 PM random picture display
Junior Talker

Posts: 2
Trades: 0
i need code for random (6) picture display
brooks gibert is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-12-2004, 10:09 PM
Montero's Avatar
Old School

Posts: 464
Location: USA - UA
Trades: 0
i think there is an option in frontpage.... im not sure though... But i definately have seen it somewhere
__________________
Used to be a Web designer.....
Switched to car sales....
Trying to get some inspiration and switch back :)
Montero is offline
Reply With Quote
View Public Profile Visit Montero's homepage!
 
Old 02-13-2004, 05:44 AM
Ultra Talker

Posts: 377
Trades: 0
you may do dmth like this in php:
<?
$num =rand(1,6);
$file="$num.gif";
?>

and place such a tag:
<img src="<?=$file?>" >
__________________
andrews_john

Please login or register to view this content. Registration is FREE
andrews_john is offline
Reply With Quote
View Public Profile Visit andrews_john's homepage!
 
Old 02-19-2004, 08:06 AM
Wenslock's Avatar
Webmaster Talker

Posts: 746
Location: Lincoln, UK
Trades: 0
I used J/S to display sort-of random images (they are based on a time system). It should be ok for what you want. I've used it a couple of times.

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
var how_many_ads = 6;
var now = new Date()
var sec = now.getSeconds()
var ad = sec % how_many_ads;
ad +=1;
if (ad==1) {
url="<URL>";
alt="<ALTERNATIVE TEXT>";
banner="<LOCATION>";
}
if (ad==2) {
url="<URL>";
alt="<ALTERNATIVE TEXT>";
banner="<LOCATION>";
}
if (ad==3) {
url="<URL>";
alt="<ALTERNATIVE TEXT>";
banner="<LOCATION>";
}
if (ad==4) {
url="<URL>";
alt="<ALTERNATIVE TEXT>";
banner="<LOCATION>";
}
if (ad==5) {
url="<URL>";
alt="<ALTERNATIVE TEXT>";
banner="<LOCATION>";
}
if (ad==6) {
url="<URL>";
alt="<ALTERNATIVE TEXT>";
banner="<LOCATION>";
}

document.write('<center>');
document.write('<a href=\"' + url + '\" target=\"_top\">');
document.write('<img src=\"' + banner + '\"');
document.write('alt=\"' + alt + '\" border=0>');
document.write('</A>');
document.write('</center>');
// End -->
</SCRIPT>
__________________
------------------------------------------------------------

Please login or register to view this content. Registration is FREE
- Black Prism professional web design services
------------------------------------------------------------
Wenslock is offline
Reply With Quote
View Public Profile
 
Old 02-19-2004, 05:37 PM
Novice Talker

Posts: 10
Location: Ontario
Trades: 0
I use jscript to do it myself, works like a charm. use an inclusion file and you can also keep the bulk of the code off of your site. i second the JScript suggestion
__________________

Please login or register to view this content. Registration is FREE

Emancipator is offline
Reply With Quote
View Public Profile
 
Old 02-22-2004, 11:53 AM
Junior Talker

Posts: 1
Location: Jax Bch - FL
Trades: 0
I use Asp/Vbscript to do this

I have 40 pics named 1.jpg, 2.jpg,...40.jpg

and just have a script to pick a random number between 1 and 40 and display the images as <img src=<%=RandomNum%>.jpg/>
__________________
Just a guy
digitaldew is offline
Reply With Quote
View Public Profile Visit digitaldew's homepage!
 
Old 02-23-2004, 06:04 AM
Wenslock's Avatar
Webmaster Talker

Posts: 746
Location: Lincoln, UK
Trades: 0
problem is digitaldew, ASP isn't the best server-side scripting out there. Also, why use it when there is no need to (in this case)? If the server that brooks gilbert is using doesn't actually support ASP or PHP, then you've got problems. As JavaScript is supported by most browsers out there now, it's the best bet.
__________________
------------------------------------------------------------

Please login or register to view this content. Registration is FREE
- Black Prism professional web design services
------------------------------------------------------------
Wenslock is offline
Reply With Quote
View Public Profile
 
Old 02-23-2004, 06:05 AM
Wenslock's Avatar
Webmaster Talker

Posts: 746
Location: Lincoln, UK
Trades: 0
sorry, the largest Internet browsers (ie. Internet Explorer and Netscape)
__________________
------------------------------------------------------------

Please login or register to view this content. Registration is FREE
- Black Prism professional web design services
------------------------------------------------------------
Wenslock is offline
Reply With Quote
View Public Profile
 
Old 02-26-2004, 06:44 PM
Novice Talker

Posts: 5
Trades: 0
andrews_john's piece of code would most likely work best...just depends on if his pages are .PHP pages.
__________________

Please login or register to view this content. Registration is FREE
- Write articles for us and get links back your site!
RockNRollPig is offline
Reply With Quote
View Public Profile Visit RockNRollPig's homepage!
 
Reply     « Reply to random picture display
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.46257 seconds with 12 queries