08-28-2008, 05:52 PM
|
#5 (permalink)
|
|
The Acquainted
Join Date: Jan 2008
Posts: 136
Thanks: 4
|
I'm really not following this, hehe. So am I correct in saying that I put the script as the source of the image with the time details? but how does the script know where to get the images etc? This is my php:
PHP Code:
<?php
$getImage = glob ( 'i/*.jpg' );
$randomImage = $getImage[array_rand($getImage, 1)];
if ( isset( $_GET['num'] ) ) {
$getNum = $_GET['num'];
if ( !is_numeric( $getNum ) ){
echo '<div id="image">Oops. Malformed URL! <br /> (Has to be a number...)</div>';
exit();
}
echo ' <div id="image">
<a href="http://laughomatic.net" ><img src="i/lom (' . $getNum . ').jpg" /></a>
</div>
<p><a id="refresh" href="http://laughomatic.net">More!</a></p>
<p><input type="text" value="http://laughomatic.net/?num=' . $getNum . '" /></p>
';
} else {
echo ' <div id="image">
<a href="javascript:this.location.reload();" ><img src="' . $randomImage . '" /></a>
</div>
<a id="refresh" href="javascript:this.location.reload();" >Next!</a>';
$pFile = (object) pathinfo($randomImage);
echo '<p><input type="text" value="http://laughomatic.net/?num=' . preg_replace('~[^\d]~i', '', $pFile->filename) . '" /></p> ';
}
?>
Sorry for being such a nuisance :(
|
|
|
|