Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: PHP Photo Album script v2.11

  1. #1
    Join Date
    Oct 2009
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default PHP Photo Album script v2.11

    1) Script Title: PHP Photo Album script v2.11

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...photoalbum.htm

    3) Describe problem: Webpage error details

    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; Creative AutoUpdate v1.40.01)
    Timestamp: Sun, 18 Oct 2009 19:57:22 UTC


    Message: 'this.navlinks.1' is null or not an object
    Line: 88
    Char: 3
    Code: 0
    URI: http://www.woronline.net/ddphpalbum.js

    http://www.woronline.net/Untitled_1.htm
    I'm kinda new to php and don't quite understand how I could fix this.
    any help would be appreciated.

  2. #2
    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

    There could be other problems. It appears though that there are no image files in your image files folder:

    http://www.woronline.net/myimages/

    Get a few images in there at least and then see what happens.
    - John
    ________________________

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

  3. #3
    Join Date
    Oct 2009
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Oh there are pictures in the folder.
    pic1

    pic 2

    pic 3

    wish it was that ez....thanks for the help

  4. #4
    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

    I see. OK, well as I said, there appear not to be. I can tell by looking at the server generated contents of your getalbumpics.php?id=Facility file. No images listed. Did you edit that file at all? If not, there is some sort of issue with how your server is interpreting it. In the past I've noticed some servers having an issue with:

    Code:
    $dirname="."
    as used in that file, so you could try this:

    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 "		[$curimage, \"$file\", \"$filedate\"],\n";
                     $curimage++;
                   }
           }
           echo "		[\"placeholder\"]\n";
           closedir($handle);
       }
       return($files);
    }
    
    $photovar=$_GET['id'];
    if (!eregi("^[a-zA-Z0-9_]+$", $photovar)){
    	echo "alert(\"Photo Album ID must contain only letters, numbers, or underscore, and cannot start with a number\")";
    	die();
    }
    echo "var $photovar={\n";
    echo "	baseurl: \"http://" . $_SERVER["SERVER_NAME"] . dirname($_SERVER['PHP_SELF']) . "/\",\n";
    echo "	images: [\n";
    returnimages();
    echo "	],\n";
    echo "	desc: []\n";
    echo "}\n";
    ?>
    But it could be some security restriction on the server not allowing a directory and/or files to be listed. Check with your host for more info on that.
    - John
    ________________________

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

  5. #5
    Join Date
    Oct 2009
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Well I tried the code that you posted and it didn't work.
    I will try to contact the server provider and see if they can help me out.

    But I am not too sure that may be the issue,I tried uploading those pages to another server and I get a different error
    Again thanks for the help.

  6. #6
    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

    That other server appears to not be PHP enabled.
    - John
    ________________________

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

  7. #7
    Join Date
    Oct 2009
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Well it may not be totally configured,after all I was the one who installed it.
    but I am sure php is working on cabooseracin web. TS_Viewer.php
    The woronline web is hosted by godaddy...so they installed the php.

  8. #8
    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

    OK, then perhaps the cabooseracin.net server doesn't allow the:

    PHP Code:
    <?
    shortcut at the beginning of the file. For that server, change it to:

    PHP Code:
    <?php
    and see what happens. But the error was vague:

    Error: invalid XML markup
    Source File: http://74.100.20.24:5190/myimages/ge...hp?id=Facility
    Line: 2
    Source Code:
    <?
    That's actually line 1, so it may be something else. For instance, the file appears to begin with a BOM, which is not recommended.

    Also, and this shouldn't be an issue, but might - you have some odd redirect going on, the links you gave in your last two posts are actually framesets.

    And I don't see the css on the cabooseracin.net server.

    Also, see:

    http://webdesign.ghhutch.com/tech_ar...strictions.php

    for an article on possible restrictions to PHP on godaddy. If the article is correct, that's your problem on that server, though the article seems to imply that they may lift these restrictions on an 'as need' basis. I'll look through the PHP file to see which restricted function(s) it requires.

    OK, looks like these are the only ones:

    opendir, readdir, closedir

    But apparently you can lift all of these restrictions yourself, at least in some cases, see:

    http://www.godaddy.com/community/Sea...sedir&ci=15525
    Last edited by jscheuer1; 10-20-2009 at 07:34 AM. Reason: add info
    - John
    ________________________

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

  9. #9
    Join Date
    Oct 2009
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by jscheuer1 View Post
    OK, then perhaps the cabooseracin.net server doesn't allow the:

    PHP Code:
    <?
    shortcut at the beginning of the file. For that server, change it to:

    PHP Code:
    <?php
    and see what happens. But the error was vague:
    Well that code helped a little on the caboose web New Code....didnt help on the godaddy web.
    Now instead of getting the undefined error I get a page that is trying to display the pics but looks like it can't find the file path to pic.

    And thanks alot for digging around for that info ...I will read that asap.

  10. #10
    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

    cabooseracin looks good now except you still are missing the css and that there appears to be either a problem due to the port number or some other information of that sort needing to be included in the path. The getalbumpics.php?id=Facility file is working correctly and the script is (as far as I can tell) writing the correct path and filenames to the page's generated HTML.

    Perhaps if you add this port number or whatever it is to the getalbumpics.php file for that server only, it may work. To try that, change this line:

    Code:
    echo "	baseurl: \"http://" . $_SERVER["SERVER_NAME"] . dirname($_SERVER['PHP_SELF']) . "/\",\n";
    to:

    Code:
    echo "	baseurl: \"http://74.100.20.24:5190/myimages/\",\n";
    On the godaddy site, you will probably have to lift the restrictions on the PHP functions as previously mentioned.
    Last edited by jscheuer1; 10-21-2009 at 06:35 AM.
    - John
    ________________________

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

  11. The Following User Says Thank You to jscheuer1 For This Useful Post:

    SAB (10-22-2009)

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
  •