SO I have an image like so:
<img src="/getVerifyPics.php5" id="" class="humanPics" alt="" onclick="" />
eventually there will be 5 images similiar to this one.
and the getVerifyPics.php5, which is not working, looks like so:
[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]
I am having a few errors. I receive an error in the second for loop, telling me that it is a mixed expression when it was looking for a string. Not sure what to do there. And I’ve noticed that didn’t clear the directory or something, because it is having trouble finding the image. getVerifyPics.php5 is in the main directory, while the pictures are in a folder titled VerifyPics.
This script is supposed to output 5 images. Please Help!