Lissa Explains it All:  Web Design Forums  

Go Back   Lissa Explains it All: Web Design Forums > LEIA Archives > Web Site Help > Advanced Programming

Notices

 
 
Thread Tools Display Modes
  #1  
Old 03-21-2007, 01:12 PM
squalls_dreams's Avatar
squalls_dreams squalls_dreams is offline
Web Wizard
 
Join Date: Jan 2003
Location: Balamb Garden Ontario
Posts: 358
squalls_dreams can only hope to improve
php random image

I have a code for a php random image and I want the random images to appear in the center of my logo..or about the center anyway. Is it possible to place my random images in my logo where ever I want them? if so..how would I do this?
__________________
:lolo: BWAHAHAHAHAHAHAHAHAHAHAHA:lolo:
Sponsored Links
  #2  
Old 03-21-2007, 02:27 PM
Arwen's Avatar
Arwen Arwen is offline
V.I.P
 
Join Date: Mar 2005
Location: Finland
Posts: 3,917
Arwen is a jewel in the roughArwen is a jewel in the roughArwen is a jewel in the rough
I'd put the script into a div.
__________________
You know you're addicted to Photoshop when...

1. You see the world with one eye and stock images with the other.
2. You ponder the meaning of existence without layers.
3. You scream out fonts as they appear on TV.
4. You're standing by the ocean and wondering who used Ocean Ripple.
  #3  
Old 03-21-2007, 02:39 PM
squalls_dreams's Avatar
squalls_dreams squalls_dreams is offline
Web Wizard
 
Join Date: Jan 2003
Location: Balamb Garden Ontario
Posts: 358
squalls_dreams can only hope to improve
how would I do that? can you give me an example. Here is my php code that I use to make my random images to appear.

PHP Code:
<?php 

$random 
"random.php"

$fp file($random); 
srand((double)microtime()*1000000); 
$rl $fp[array_rand($fp)]; 
echo 
$rl
?>
__________________
:lolo: BWAHAHAHAHAHAHAHAHAHAHAHA:lolo:
  #4  
Old 03-21-2007, 05:05 PM
Idiotic Creation's Avatar
Idiotic Creation Idiotic Creation is offline
In Color!
 
Join Date: Feb 2006
Location: Economy size cardboard box
Posts: 506
Idiotic Creation is on a distinguished road
Assuming that $rl is the code to display the image.

Where ever that echo statement is within your html structure is exactly where the image will be placed.

David
__________________
“Do all the good you can, By all the means you can, In all the ways you can, In all the places you can, At all the times you can, To all the people you can, As long as ever you can.”
-John Wesley
  #5  
Old 03-21-2007, 05:35 PM
squalls_dreams's Avatar
squalls_dreams squalls_dreams is offline
Web Wizard
 
Join Date: Jan 2003
Location: Balamb Garden Ontario
Posts: 358
squalls_dreams can only hope to improve
I'm lost..what are you talking about?
__________________
:lolo: BWAHAHAHAHAHAHAHAHAHAHAHA:lolo:
  #6  
Old 03-22-2007, 01:05 PM
squalls_dreams's Avatar
squalls_dreams squalls_dreams is offline
Web Wizard
 
Join Date: Jan 2003
Location: Balamb Garden Ontario
Posts: 358
squalls_dreams can only hope to improve
ohhh ok..well thats why I'm asking how would I align this? can someone give me an example please?
__________________
:lolo: BWAHAHAHAHAHAHAHAHAHAHAHA:lolo:
  #7  
Old 03-23-2007, 05:46 PM
Cruzn Cruzn is offline
n00bzilla
 
Join Date: Mar 2005
Posts: 27
Cruzn is an unknown quantity at this point
As Arwen suggested, you could put your image inside a divider and then align it with CSS.

HTML Code:
<html>
<head>
<title>Example Page</title>
</head>
<body>

<?
$random = "random.php"; 

$fp = file($random);
srand((double)microtime()*1000000);
$rl = $fp[array_rand($fp)];
?>
<!-- Just an example, but you would probably get a better result trying to align your divider with CSS -->
<div align="center"><? echo $rl ?></div>

</body>
</html>
  #8  
Old 03-26-2007, 05:14 PM
squalls_dreams's Avatar
squalls_dreams squalls_dreams is offline
Web Wizard
 
Join Date: Jan 2003
Location: Balamb Garden Ontario
Posts: 358
squalls_dreams can only hope to improve
alright..thanks..I actually made a new php page and just added the code and then I put an iframe and aligned that iframe with css. But I'll try it this way and see how it turns out.
__________________
:lolo: BWAHAHAHAHAHAHAHAHAHAHAHA:lolo:
  #9  
Old 03-28-2007, 05:25 AM
iGeek's Avatar
iGeek iGeek is offline
PHP Ninja
 
Join Date: Sep 2004
Location: Colorado, USA
Posts: 2,856
iGeek has a spectacular auraiGeek has a spectacular auraiGeek has a spectacular aura
I highly advise against any type of frames.

Also, wouldn't it be easier to do this:

Code:
<img src="image<?php echo(rand(1,20)); ?>.gif">
That would choose a random number between 1 and 20 then echo it, so the result would be "image6.gif" or whatever. Then you just have all the images used and viola. And yeah, put it in a div:

Code:
<div style="margin: 0px auto;">
<img src="image<?php echo(rand(1,20)); ?>.gif">
</div>
And that would align everything to the middle.
__________________

  #10  
Old 03-28-2007, 12:45 PM
squalls_dreams's Avatar
squalls_dreams squalls_dreams is offline
Web Wizard
 
Join Date: Jan 2003
Location: Balamb Garden Ontario
Posts: 358
squalls_dreams can only hope to improve
thanks..can you maybe try and code it out for me? here is an example of what my layout looks like.

http://johnfisher.myknet.org/bleach/index.php
__________________
:lolo: BWAHAHAHAHAHAHAHAHAHAHAHA:lolo:
 

Thread Tools
Display Modes

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 Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
please help help 4 friendster joue CSS 1 10-01-2005 03:03 PM
Random order of content in PHP? I, Brian Advanced Programming 5 09-20-2005 07:52 PM
random image itsme JavaScript/DHTML 4 03-26-2005 12:13 PM
Php Scripting... BASIC - INTERMEDIATE... (includes full mysql tutorial) Mushroom5698 User Submitted Tutorials 3 05-19-2004 12:22 PM


All times are GMT. The time now is 11:33 PM.


Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.