Hardwarez Posted November 13, 2006 Share Posted November 13, 2006 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.. Quote Link to comment Share on other sites More sharing options...
simcoweb Posted November 13, 2006 Share Posted November 13, 2006 Are you trying to create a security image? As in a CAPTCHA? Where they type in a random code before submitting the form? Quote Link to comment Share on other sites More sharing options...
Hardwarez Posted November 14, 2006 Author Share Posted November 14, 2006 Yes, that is what I am trying to do Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted November 14, 2006 Share Posted November 14, 2006 http://bokehman.com/captcha_verification Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.