0 members and 19,070 guests
No Members online

» Site Navigation
» Stats
Members: 35,442
Threads: 103,075
Posts: 826,688
Top Poster: cc.RadillacVIII (7,429)
|
-
this isn't really a tutorial, but I couldn't find out a place to post it. So here it goes. I originally wrote this script in Javascript, but than my friend later ported it to PHP and I just kept it. Made some minor changes to it though.
Code:
<?php
$gen = rand(1,5); //change last number to number of images you have
print("<img src="dir/to/imgs/splash$gen.jpg">");
?>
okay, um place this script within the body tags of your layout. Change "dir/to/imgs" to the directory that houses your image. Re-name all your images to splash1.jpg, splash2.jpg, splash3.jpg, etc. All the way up to the last number you put in "rand(1,5)".
I have tried this script and it seems to work just fine. Just reply if you encounter a problem.
-
Thanks for this, im gonna be starting to learn php soon. Will come in handy.
-
no problem. happy to help, thats what coders are for :P
-
Does it work here? I know I've tried a CGI script for this and it told me that it doesn't allow dynamic url or something along that line...
-
Originally posted by Psypher@Jun 21 2005, 08:06 PM
Does it work here?* I know I've tried a CGI script for this and it told me that it doesn't allow dynamic url or something along that line... 
[snapback]67598[/snapback]
yes, it works. Im not too fond of CGI, so I dont know what could have gone wrong. I've used this script numerous times before, and it works just fine.
-
and where should i write in code, where i wanna show the picture?
-
Code:
print("<img src="dir/to/imgs/splash$gen.jpg">");
wont work... must be like:
Code:
print("<img src=\"dir/to/imgs/splash$gen.jpg\">");
-
Originally posted by TyR@Jun 22 2005, 01:36 PM
Code:
print("<img src="dir/to/imgs/splash$gen.jpg">");
wont work... must be like:
Code:
print("<img src=\"dir/to/imgs/splash$gen.jpg\">");

[snapback]67895[/snapback]
forgot about that... but catching mistakes is the fun part of programming though.
-
no thank u i just barely learned ps
-
Originally posted by dakid@Jun 22 2005, 05:51 PM
no thank u i just barely learned ps
[snapback]68016[/snapback]
oh lol... PHP isn't hard to learn, of course my first language was C++...
Similar Threads
-
By Wade in forum Other Tutorials
Replies: 7
Last Post: 09-04-2006, 09:56 PM
-
By nosferatu in forum Digital Art
Replies: 2
Last Post: 12-15-2005, 01:34 PM
-
By NightStalker in forum Other Tutorials
Replies: 4
Last Post: 09-24-2005, 07:13 AM
-
By the_dude_of_darkness in forum The Void
Replies: 8
Last Post: 06-18-2005, 10:24 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|