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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.