Jump to content

Method for Rand Pic / Turning Request


Hardwarez

Recommended Posts

Can anyone tell me a good way to display a series of random pictures without doing this:
[code]
echo '<img src="' . $img . '" alt="Turning Test, to prevent machine access to page"/>';
[/code]

After all, for a turing request I would think it best to not be able to see a picture names in the source!

I tried this, but it does not work in internet explorer:
[code]while ($n > 0){
$y=rand(0,9);
$img = $path . $pics[$y];
$handle=fopen($img,"r");
$data=fread($handle, filesize($img));
fclose($handle);
$pic=base64_encode($data);
echo "<img width=50 height=50 src=\"data:image/gif;base64,$pic\">\n";
$mynum = $mynum . $y;
--$n;
}[/code]
I even tried the header thing.
[code]header("Content-type: image/jpeg")[/code]
How do I get this to display more than one pic?  This method also prevented the rest of my code from executing..
Link to comment
https://forums.phpfreaks.com/topic/27156-method-for-rand-pic-turning-request/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.