![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I found this site: http://www.carltonward.com Everytime the index page is refreshed, a different image pops up. I'm not proficient with code yet, and I was wondering if someone could help me figure out how to make this happen. What code is being used and where should it be placed? Thanks for your time... www.isaacbrown.net |
#3
| |||
| |||
|
|
I found this site: http://www.carltonward.com Everytime the index page is refreshed, a different image pops up. I'm not proficient with code yet, and I was wondering if someone could help me figure out how to make this happen. What code is being used and where should it be placed? Thanks for your time... www.isaacbrown.net |
#4
| |||
| |||
|
|
You could store all your images in a directory and name them 1,2,3,4,5. Then use your scriptin language to generate a random number. In PHP this would look something like: img src="images/<? echo rand(1, 5); ?>.jpg" |
#5
| |||
| |||
|
#6
| |||
| |||
|
|
.oO(Shaun) You could store all your images in a directory and name them 1,2,3,4,5. Then use your scriptin language to generate a random number. In PHP this would look something like: img src="images/<? echo rand(1, 5); ?>.jpg" OK, but: If you want your code be reliable and portable you should avoid short open tags and use the correct <?php ... ?> instead. Short open tags could be disabled on some machines and are a problem if you use XML. Micha |
#7
| |||
| |||
|
|
Thanks I didn't know that, how about using this format for inserting code into HTML <?=$myVar? |
![]() |
| Thread Tools | |
| Display Modes | |
| |