Freq245 Posted April 20, 2006 Share Posted April 20, 2006 I'm using this php code at the moment, but it doesn't work for me, though, at an other server it does.[code]$bilder=array("...","...");mt_srand ((double)microtime()*1000000);$zahl = mt_rand(0,(count($bilder) - 1));echo ("<a href=\"http://www...".$bilder[$zahl]."\"></a>");[/code]I've a table and would like to display an image in it, which changes if one clicks at it.Thank you. Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted April 20, 2006 Share Posted April 20, 2006 Look at the function [a href=\"http://www.php.net/array_rand\" target=\"_blank\"]array_rand()[/a][code]<?php$bilder=array("...","...");$rand_key = array_rand($bilder);echo '<a href="http://www...' . $bilder[$rand_key] . '"></a>';?>[/code]Ken Quote Link to comment Share on other sites More sharing options...
Freq245 Posted April 20, 2006 Author Share Posted April 20, 2006 Your code doesn't work for me, too. :( Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted April 20, 2006 Share Posted April 20, 2006 What do you me "doesn't work". What is failing? How is it failing? Is there more to your script that you're not posting that could have an impact on this code?Ken Quote Link to comment Share on other sites More sharing options...
Freq245 Posted April 21, 2006 Author Share Posted April 21, 2006 It's working now. There was a bug in the server, so I wasn't able to use php. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.