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.. Link to comment https://forums.phpfreaks.com/topic/27156-method-for-rand-pic-turning-request/ 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? Link to comment https://forums.phpfreaks.com/topic/27156-method-for-rand-pic-turning-request/#findComment-124152 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 Link to comment https://forums.phpfreaks.com/topic/27156-method-for-rand-pic-turning-request/#findComment-124533 Share on other sites More sharing options...
The Little Guy Posted November 14, 2006 Share Posted November 14, 2006 http://bokehman.com/captcha_verification Link to comment https://forums.phpfreaks.com/topic/27156-method-for-rand-pic-turning-request/#findComment-124538 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.