2007-05-12, 05:59 AM
Hi, I want to randomize my avatar, but I can't seem to get it to work. I already have a php script on my website which returns a random url string. This is the script:
<pre>
<?php
$images[] = 'http://...avatar1.png';
$images[] = 'http://...avatar2.png';
srand ((double) microtime() * 1000000);
$random_number = rand(0,count($images)-1);
echo ($images[$random_number]);
?>
</pre>
(I had to shorten the urls for this message board because they were too long)
When I load my the page - it shows a text string of one of the urls.
But when I paste the link of my page into the 'Avatar URL:' field, it says the url is invalid. I was hoping that by returning the url, my avatar url can pretty much be randomized.
How can I get my avatar to show a random image? Or perhaps I'm doing this entirely wrong?
<pre>
<?php
$images[] = 'http://...avatar1.png';
$images[] = 'http://...avatar2.png';
srand ((double) microtime() * 1000000);
$random_number = rand(0,count($images)-1);
echo ($images[$random_number]);
?>
</pre>
(I had to shorten the urls for this message board because they were too long)
When I load my the page - it shows a text string of one of the urls.
But when I paste the link of my page into the 'Avatar URL:' field, it says the url is invalid. I was hoping that by returning the url, my avatar url can pretty much be randomized.
How can I get my avatar to show a random image? Or perhaps I'm doing this entirely wrong?