When I type in this code:
if(isset($_GET["img"])){ die(); }It doesn't kill the code.
But at the video it kills the video.
It doesn't display any error either though, it just displays the boxes where the images should be like in the video before 11:30.
Then I tried to get some error from it and typed this code:
print_r($_GET["img"]);I got the following error out of it:
"Notice: Undefined index: img in"
So it doesn't find any img?
I hope somebody could help me out, thanks in advance.
My full code is here:
<?php if(isset($_GET['img'])){ die(); } if(is_dir('./thumbs') === false){ mkdir('./thumbs', 0744); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <?php $images = glob('*.{jpg,jpeg,png,gif}', GLOB_BRACE); foreach($images as $image){ if(file_exists("./thumbs/{$image}")){ echo "<a href=\"{$images}\"><img src=\"./thumbs/{$image}\" alt=\"{$image}\" /></a>"; }else{ echo "<a href=\"{$images}\"><img src=\"?img={$image}\" alt=\"{$image}\" /></a>"; } } print_r($_GET["img"]); ?> <body> </body> </html>