On Thu, 7 Nov 2002, Ernest E Vogelsinger wrote: > At 16:57 07.11.2002, [EMAIL PROTECTED] 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php