Please Help Me!
I’m not very proficient in php yet.
So I have five of these lined up, just one for now, I haven’t figured out how to loop through and dump 5 yet.
<img src="/getVerifyPics.php5" id="" class="humanPics" alt="" onclick="" />
But getVerifyPics.php5 isn’t working. When I run it through this online php checker thing (http://www.icosaedro.it/phplint/phplint-on-line.html) it hits an error in the second for loop. Something about expecting a string when it’s a mixed expression. And I think I need to change the root directory somehow? I tried to make it clear ish with comments.
[php]<?php
//names of the 5 images
$letter = array(“A”, “B”, “C”, “D”, “E”); //first half
shuffle($letter);
$number = array(); //second half
for ($i=0; $i<=4; $i++) {
$number[$i] = rand(1,3);//5 random numbers 1-3 stored in num0 to num4
}
shuffle($number);
//put the pieces together; randomly ordered picture files
$img = array();
for ($pi=0; $pi<=4; $pi++) {
$img[$pi] = "/VerifyPics/" . $letter[$pi] . $number[$pi] . ".jpg";
}
shuffle($img); //one last shuffle for good measure
$fp = fopen($img[0], 'rb');
//headers
header("Content-Type: image/jpeg");
header("Content-Length: " . filesize($img[0]));
//dump and exit
fpassthru($fp);
exit;
?>[/php]