I'm trying to come up with a way to link to an image dynamically that will change every day. I created a page that displays a random image and would like to call it using
<IMG width=88 height=88 src='http://www.mydomain.com/potd.php?type=thumb2' border='0'>
I've seen other sites do this or use a similar method. However, this is not working. Has anyone tried anything like this before?
<?php $file = file('http://www.mydomain.com/potd.php?type=thumb2'); $imgSrc = $file[0]; echo "<img src=\"$imgSrc\">"; ?>
Your potd.php
// do some random stuff.. and use the $_GET['type'] { } echo 'http://www.mydomain.com/imgDir/'.$randomImage;
Is there any way to do the code on the main page so that it doesn't require the end user to have PHP. Anything can be on the potd.php page.