Also, could I change the line:
return '<img src="./'.$randir[$getrandir].''.$imgarray[$rand].'" width="600" align="top">';
so that if I click it, it also opens randomizer.php?
For example, could I <a href a php returned image as well?
I attached the randomizer.php file to this post.
Oh and 8ennet, I started the php tutorial and am reading it daily.
Yes you can change the line:
return '<img src="./'.$randir[$getrandir].''.$imgarray[$rand].'" width="600" align="top">';
to:
return '<a href="http://www.loldmypan...zer.php#bottom" target="_blank" border="0"><img src="./'.$randir[$getrandir].''.$imgarray[$rand].'" width="600" align="top"></a>';
This will open randomizer in a new tab (or window) however if you want it to load on the current page remove target="_blank". Also we set the border to 0 so that default blue square isn't around the edge of your image (the kind that turns purple once you have visited that link).
Also great to hear you are reading that tutorial, how's it going?




