Results 1 to 3 of 3

Thread: PHP Photo Album Script

  1. #1
    Join Date
    Jun 2008
    Location
    Georgia
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question PHP Photo Album Script

    1) Script Title: PHP Photo Album Script

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...photoalbum.htm
    3) Describe problem: Having problems viewing the images on this site. any help greatly appreciated.

    http://www.midianroofing.net/images/...il/getpics.php

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    It seems your web host is dynamically adding to all PHP files served extra code for ads:

    Code:
    </object></layer></span></div></table></body></html><!-- adsok -->
    <script language='javascript' src='https://a12.alphagodaddy.com/hosting_ads/gd01.js'></script>
    This is corrupting the script. You'll need to host the PHP file for the script on a host that doesn't do this.

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    It's just possible that adding an opening script comment block at the end of the getpics.php file will take care of the problem. It's worth a try:

    Code:
    <?
    Header("content-type: application/x-javascript");
    
    function returnimages($dirname=".") {
       $pattern="\.(jpg|jpeg|png|gif|bmp)$";
       $files = array();
       $curimage=0;
       if($handle = opendir($dirname)) {
           while(false !== ($file = readdir($handle))){
                   if(eregi($pattern, $file)){
    		 $filedate=date ("M d, Y H:i:s", filemtime($file));
                     echo 'galleryarray[' . $curimage .']=["' . $file . '", "'.$filedate.'"];' . "\n";
                     $curimage++;
                   }
           }
    
           closedir($handle);
       }
       return($files);
    }
    
    echo "var galleryarray=new Array();" . "\n";
    returnimages();
    ?> 
    
    /*
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •