Woody777 Posted October 4, 2014 Share Posted October 4, 2014 Hi there guys I have a problem that I can't seem to get fixed. Below Is the code I am using and the Link to the Tutorial: http://fearlessflyer.com/create-an-awesome-photo-gallery-with-fancybox-and-timthumb/ <?php $path = 'http://' . $_SERVER['SERVER_NAME'] . 'moment/uploads/'; $files = scandir('uploads/'); ?> <ul> <?php foreach ($files as $file){ if ($file == '.' || $file == '..'){ echo ''; } else { ?> <li ><a href="<?php echo $path . $file; ?>" rel="lightbox"><img src="timthumb.php?src=<?php echo $path . $file; ?>&h=194&w=224&zc=1&q=100" /></a></li> <?php } }?> </ul> <!-- FANCYBOX --> <script type='text/javascript' src='assets/js/jquery.fancybox.js'></script> <script type='text/javascript' src='assets/js/jquery.mousewheel-3.0.6.pack.js'></script> <link rel='stylesheet' href='assets/css/jquery.fancybox.css' /> <script> $(document).ready(function(){ $("a[rel=lightbox]").fancybox({ 'transitionIn' : 'elastic', 'transitionOut' : 'elastic' }); }); </script> My pictures and everything is working but when I click on the image to open up in a lightbox it gives me an error: The Requested Content Cannot Be Loaded, Please Try Again Later. In the attached is a image of the error Quote Link to comment https://forums.phpfreaks.com/topic/291440-fancybox-error-the-requested-content-cannot-be-loaded-please-try-again-later/ Share on other sites More sharing options...
jcbones Posted October 5, 2014 Share Posted October 5, 2014 Should these <li ><a href="<?php echo $path . $file; ?>" rel="lightbox"><img src="timthumb.php?src=<?php echo $path . $file; ?>&h=194&w=224&zc=1&q=100" /></a></li> links not point to the same source? You want the link to an actual file, but you are generating the thumb. While that is theoretically correct, are you sure that you are pointing the link at the correct source? Quote Link to comment https://forums.phpfreaks.com/topic/291440-fancybox-error-the-requested-content-cannot-be-loaded-please-try-again-later/#findComment-1492756 Share on other sites More sharing options...
Woody777 Posted October 5, 2014 Author Share Posted October 5, 2014 Yes I have followed that tutorial and done exactly what they did. I will have a look. thank you for the reply Quote Link to comment https://forums.phpfreaks.com/topic/291440-fancybox-error-the-requested-content-cannot-be-loaded-please-try-again-later/#findComment-1492759 Share on other sites More sharing options...
jcbones Posted October 5, 2014 Share Posted October 5, 2014 You may want to point your anchor tag to the full url, is what I am saying. Quote Link to comment https://forums.phpfreaks.com/topic/291440-fancybox-error-the-requested-content-cannot-be-loaded-please-try-again-later/#findComment-1492774 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.