Re: Outputting multiple images
| From: | ed at home dot homes2see dot com | Date: | Thu, 07 Nov 2002 16:44:45 +0000 |
| Subject: | Re: Outputting multiple images | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-123186@lists.php.net to get a copy of this message | ||
On Thu, 7 Nov 2002, Ernest E Vogelsinger wrote:
> At 16:57 07.11.2002, ed@home.homes2see.com spoke out and said:
> --------------------[snip]--------------------
> > I think the random number query will work but I have a problem with the
> >context of the echo line.
> >
> >Here's how I get the image path.
> >
> ><?
> >$root_path = "/www/special_projects/Elkhart";
> >$agent_url = "$root_path/$agent_name";
> >?>
> >
> ><img src="<? echo $agent_url; ?>">
> >
> >How would I use the rand function in the above statement?
> --------------------[snip]--------------------
>
> 1) I believe the root path you gave is the server's file path, not the URL
> it should point to... well, it just looks like this.
>
> 2) code your template like this:
> <img src="<?php echo "$root_path/$agent_name?r=",
> random();?>">
>
> This will result in something like
> <img src="/www/special_projects/Elkhart/your.agent.jpg?r=17382">
I got it working by doing thus:
<img src="<? echo $agent_url; ?>.jpg?<? echo rand(1000,9999); ?>>
Thanks for all the help guys!
Ed