shruti149 Posted June 20, 2010 Share Posted June 20, 2010 Hi everyone, My name is shruti and i'm new to php i have generated a code for random image slide show of 200 images without repetition and code is taking up to 150 images and nothing is been executed when i increased the image size can anyone please help me with this.My code is <html> <head> <meta http-equiv="refresh" content="4"> </head> <?php $file_array = array ( "images/bag200.bmp", "images/bag178.bmp", "images/bag004.bmp", "images/bag005.bmp", "images/bag006.bmp", "images/bag192.bmp", "images/bag008.bmp", "images/bag009.bmp", "images/bag186.bmp", "images/bag011.bmp", "images/bag012.bmp", "images/bag013.bmp", "images/bag171.bmp", "images/bag162.bmp", "images/bag016.bmp", "images/bag017.bmp", "images/bag018.bmp", "images/bag163.bmp", "images/bag020.bmp", "images/bag021.bmp", "images/bag022.bmp", "images/bag172.bmp", "images/bag183.bmp", "images/bag025.bmp", "images/bag026.bmp", "images/bag027.bmp", "images/bag164.bmp", "images/bag029.bmp", "images/bag030.bmp", "images/bag031.bmp", "images/bag175.bmp", "images/bag033.bmp", "images/bag186.bmp", "images/bag035.bmp", "images/bag036.bmp", "images/bag195.bmp", "images/bag038.bmp", "images/bag039.bmp", "images/bag040.bmp", "images/bag041.bmp", "images/bag042.bmp", "images/bag043.bmp", "images/bag176.bmp", "images/bag187.bmp", "images/bag196.bmp", "images/bag047.bmp", "images/bag048.bmp", "images/bag049.bmp", "images/bag050.bmp", "images/bag051.bmp", "images/bag052.bmp", "images/bag053.bmp", "images/bag054.bmp", "images/bag055.bmp", "images/bag188.bmp", "images/bag057.bmp", "images/bag058.bmp", "images/bag059.bmp", "images/bag178.bmp", "images/bag189.bmp", "images/bag062.bmp", "images/bag063.bmp", "images/bag064.bmp", "images/bag193.bmp", "images/bag190.bmp", "images/bag067.bmp", "images/bag068.bmp", "images/bag069.bmp", "images/bag070.bmp", "images/bag071.bmp", "images/bag072.bmp", "images/bag073.bmp", "images/bag077.bmp", "images/bag075.bmp", "images/bag076.bmp", "images/bag161.bmp", "images/bag078.bmp", "images/bag079.bmp", "images/bag081.bmp", "images/bag082.bmp", "images/bag083.bmp", "images/bag084.bmp", "images/bag085.bmp", "images/bag086.bmp", "images/bag197.bmp", "images/bag088.bmp", "images/bag089.bmp", "images/bag090.bmp", "images/bag191.bmp", "images/bag006.bmp", "images/bag093.bmp", "images/bag094.bmp", "images/bag095.bmp", "images/bag096.bmp", "images/bag097.bmp", "images/bag098.bmp", "images/bag099.bmp", "images/bag164.bmp", "images/bag181.bmp", "images/bag102.bmp", "images/bag103.bmp", "images/bag104.bmp", "images/bag105.bmp", "images/bag182.bmp", "images/bag107.bmp", "images/bag108.bmp", "images/bag109.bmp", "images/bag110.bmp", "images/bag174.bmp", "images/bag185.bmp", "images/bag113.bmp", "images/bag114.bmp", "images/bag115.bmp", "images/bag116.bmp", "images/bag117.bmp", "images/bag118.bmp", "images/bag119.bmp", "images/bag170.bmp", "images/bag121.bmp", "images/bag122.bmp", "images/bag123.bmp", "images/bag124.bmp", "images/bag179.bmp", "images/bag126.bmp", "images/bag127.bmp", "images/bag128.bmp", "images/bag129.bmp", "images/bag130.bmp", "images/bag131.bmp", "images/bag132.bmp", "images/bag167.bmp", "images/bag184.bmp", "images/bag135.bmp", "images/bag136.bmp", "images/bag137.bmp", "images/bag194.bmp", "images/bag139.bmp", "images/bag140.bmp", "images/bag141.bmp", "images/bag142.bmp", "images/bag143.bmp", "images/bag198.bmp", "images/bag145.bmp", "images/bag146.bmp", "images/bag147.bmp", "images/bag148.bmp", "images/bag168.bmp", "images/bag150.bmp", "images/bag151.bmp", "images/bag152.bmp", "images/bag153.bmp", "images/bag154.bmp", "images/bag169.bmp", "images/bag200.bmp", "images/bag157.bmp", "images/bag158.bmp", "images/bag159.bmp", "images/bag160.bmp", "images/bag002.bmp", "images/bag014.bmp", "images/bag019.bmp", "images/bag027.bmp", "images/bag165.bmp", "images/bag166.bmp", "images/bag133.bmp", "images/bag149.bmp", "images/bag155.bmp", "images/bag120.bmp", "images/bag013.bmp", "images/bag173.bmp", "images/bag022.bmp", "images/bag111.bmp", "images/bag031.bmp", "images/bag043.bmp", "images/bag177.bmp", "images/bag180.bmp", "images/bag125.bmp", "images/bag003.bmp", "images/bag101.bmp", "images/bag182.bmp", "images/bag106.bmp", "images/bag024.bmp", "images/bag112.bmp", "images/bag009.bmp", "images/bag044.bmp", "images/bag055.bmp", "images/bag189.bmp", "images/bag090.bmp", "images/bag091.bmp", "images/bag006.bmp", "images/bag065.bmp", "images/bag194.bmp", "images/bag138.bmp", "images/bag036.bmp", "images/bag087.bmp", "images/bag144.bmp", "images/bag199.bmp", "images/bag001.bmp", "images/bag100.bmp" ); $rand_array = array(); $rand_id = array(); $img_id = array ("1", "1", "0", "0", "0", "1", "0", "0", "1", "0", "0", "0", "1", "1", "0", "0", "0", "1", "0", "0", "0", "1", "1", "0", "0", "0", "1", "0", "0", "0", "1", "0", "1", "0", "0", "1", "0", "0", "0", "0", "0", "0", "1", "1", "1", "0", "0", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "1", "1", "0", "0", "0", "1", "1", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "0", "1", "1", "0", "0", "0", "0", "1", "0", "0", "0", "0", "1", "1", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "1", "1", "0", "0", "0", "1", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "1", "1", "0", "0", "0", "1", "0", "0", "0", "0", "1", "1", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "1", "1", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "1", "0", "0", "0", "0", "1", "0", "0"); $tst = $file_array[array_rand($file_array)]; $id = $img_id[array_rand($file_array)]; for ($i=0;$i<200;$i++) { while (in_array($tst,$rand_array)){ $tst = $file_array[array_rand($file_array)]; $id = $img_id[array_rand($file_array)];} $rand_array[] = $tst; $rand_id[] = $id; } ?> <body> <center> <img src='<?php echo $tst ?>' name='r_img' id='<?php echo $id ?>' /> <form name="myForm"> <input type="button" name="btn1" value="Stop bag" onclick="btn_click()" /> </form> </center> </body> <script> var imgname = '<?php echo $tst?>'; var flag = 1; if(flag == 1) setTimeout("msg(flag)",3900); function msg(flag) { if(flag == 1) { if(document.r_img.id == 1) { alert("MISS:You missed the target"); var miss ="successc.php?name="+imgname; pausecom(1000); } else { alert("Correct Rejection: No Target"); var cr ="successc.php?name="+imgname; pausecom(1000); } } return 1; } function btn_click() { flag = 0; if(document.r_img.id == 1) { alert("Hit: Good Job"); var hit ="miss.php?s="+sec+'&name='+imgname; pausecom(1000); } else { alert("False Alarm: Oops You stopped the bag without knife"); var fa ="miss.php?s="+sec+'&name='+imgname; pausecom(1000); } } function pausecom(millisec) { var date = new Date(); var curDate = null; do { curDate = new Date(); } while(curDate-date < millisec); } function display(){ if (milisec>=9) { milisec=0; seconds+=1; } else milisec+=1; d = seconds + "." + milisec; setTimeout("display()",100); if(seconds>=3) { seconds = 0; } sec = d; } display(); </script> </html> [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/205313-cannot-display-images-beyond-150/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.