amwd07 Posted August 24, 2008 Share Posted August 24, 2008 Hello Guys I hope soemone can offer me some advice here I have recently upgraded my server to MYSQL 5 & PHP 5.24 everything has gone smoothly except 1 site which seems to maybe have an issue with the folowing coding? <?php $dir = 'images'; // folder with image folders if(is_dir($dir)) { $fp = opendir($dir); // open folder while(false!==($carpeta = readdir($fp))) { // reading folders if($carpeta != ".." && $carpeta != ""){ if($carpeta != "." && $carpeta != ""){ echo '<div id="'.$carpeta.'" class="galleryElement">'; echo '<h2>'.$carpeta.'</h2>'; $dir2 = $dir."/".$carpeta; // Image folder $dir3 = $dir."/".$carpeta."/tn"; // Thumbnail folder $Ext = array('jpg','png','gif'); // Image types $countExt = count($Ext); if(is_dir($dir2)) { $fp2 = opendir($dir2); while(false!==($file = readdir($fp2))) { for($i=0;$i<$countExt;$i++) { if(strpos($file,$Ext[$i],1)) { // show all images image types selected echo '<div class="imageElement">'; echo '<h3>'.$file.'</h3>'; echo '<p>'.$file.'</p>'; echo '<a href="#" title="open image" class="open"></a>'; echo '<img src="'.$dir2.'/'.$file.'" class="full" alt="'.$file.'">'; echo '<img src="'.$dir3.'/'.$file.'" class="thumbnail" alt="'.$file.'">'; echo '</div>'; } } } closedir($fp2); } echo '</div>'; } } } } closedir($fp); ?> Quote Link to comment https://forums.phpfreaks.com/topic/121154-solved-coding-compatibility-after-server-upgrade/ Share on other sites More sharing options...
DeanWhitehouse Posted August 24, 2008 Share Posted August 24, 2008 Whats the problem?? also add some error reporting error_reporting(E_ALL); and something like ini_set(ERROR_REPORTING); Quote Link to comment https://forums.phpfreaks.com/topic/121154-solved-coding-compatibility-after-server-upgrade/#findComment-624562 Share on other sites More sharing options...
amwd07 Posted August 24, 2008 Author Share Posted August 24, 2008 thanks good suggestion I will try this now Quote Link to comment https://forums.phpfreaks.com/topic/121154-solved-coding-compatibility-after-server-upgrade/#findComment-624564 Share on other sites More sharing options...
amwd07 Posted August 24, 2008 Author Share Posted August 24, 2008 That's strange there are no errors to report but I know this worked before server upgrade so is there soemthignin my code not used in the later version PHP? Quote Link to comment https://forums.phpfreaks.com/topic/121154-solved-coding-compatibility-after-server-upgrade/#findComment-624567 Share on other sites More sharing options...
DeanWhitehouse Posted August 24, 2008 Share Posted August 24, 2008 you havent told us what the problems are. Quote Link to comment https://forums.phpfreaks.com/topic/121154-solved-coding-compatibility-after-server-upgrade/#findComment-624569 Share on other sites More sharing options...
amwd07 Posted August 24, 2008 Author Share Posted August 24, 2008 Ok it's a strange one I have smooth gallery which is a ajax slideshow if I put in there sample code it displays images so I know there gallery works a few days ago this was all workign before my server upgrade with the code previously posted The only error i am now getting is a JS error elements.0.thumbnail is null or not a valid object wihich is very stange condiering with the default HTML sample this works so this has to be down to the server upgrade & the PHP i'm using ??? Quote Link to comment https://forums.phpfreaks.com/topic/121154-solved-coding-compatibility-after-server-upgrade/#findComment-624571 Share on other sites More sharing options...
amwd07 Posted August 25, 2008 Author Share Posted August 25, 2008 Sorry guys My code was correct is was the file permissions which was the problem Quote Link to comment https://forums.phpfreaks.com/topic/121154-solved-coding-compatibility-after-server-upgrade/#findComment-624902 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.