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

Thread: PHP Album. Can't get it to work.

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

    Default PHP Album. Can't get it to work.

    1) Script Title: PHP Photo Album 2.0

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

    3) Describe problem:

    I've been trying to get the script installed on my web site for a couple of days, and I can't get it to work. Regardless of what I try, I am always getting an error message:

    Java Script Error
    Description: 'myvacation' is undefined

    The error message then points me to the line

    new phpimagealbum({
    albumvar: myvacation,

    in your script. I am using Apache 2.2 and PHP 5.3.

  2. #2
    Join Date
    Aug 2009
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Oh, also: It says:

    (make sure the path to it inside ddphpalbum.js is correct).

    referring to ddphpalbum.css with "it". What do you mean by that? I cannot find a reference to ddphpalbum.css in ddphpalbum.js.

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

    Default

    Please post a link to the page on your site that contains the problematic script so we can check it out.
    DD Admin

  4. #4
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    Quote Originally Posted by nunofyer bzness View Post
    Oh, also: It says:

    (make sure the path to it inside ddphpalbum.js is correct).

    referring to ddphpalbum.css with "it". What do you mean by that? I cannot find a reference to ddphpalbum.css in ddphpalbum.js.
    This is referring to the loading gif reference inside the javascript file.

  5. #5
    Join Date
    Aug 2009
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Sorry, the website is not public yet, so I guess I can't give you a website to check the code, but I am following exactly the instructions on the web page.

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

    Default

    That particular error message simply means the script cannot locate the dynamically generated array with name "vacation". Most likely the following line in the HEAD section of your page isn't set up correctly:

    Code:
    <script type="text/javascript" src="http://www.mysite.com/myimages/getalbumpics.php?id=myvacation"></script>
    Make sure "getalbumpics.php" is correctly uploaded to your server and inside the directory where all your pages are. Also, make sure the path above correctly references this PHP file.
    DD Admin

  7. #7
    Join Date
    Aug 2009
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by ddadmin View Post
    That particular error message simply means the script cannot locate the dynamically generated array with name "vacation". Most likely the following line in the HEAD section of your page isn't set up correctly:

    Code:
    <script type="text/javascript" src="http://www.mysite.com/myimages/getalbumpics.php?id=myvacation"></script>
    Make sure "getalbumpics.php" is correctly uploaded to your server and inside the directory where all your pages are. Also, make sure the path above correctly references this PHP file.
    I have checked and re-checked this many times. I did have a problem with the webroot of Apache, and not it seems I am not getting the error message anymore, but I don't get the album either. I am almost ready to give up and try something else.

    This may not be a problem with the script. I just tested to following:

    1) I set up a php file with just the following line:

    <?php echo "This is a Test"; ?>

    and saved it in the webroot folder, then opened a browser and entered "localhost/test.php" as the URL. I get a Browser Window that says "This is a Test". Looks like php is working and doing well.

    2)Then I set up another PHP file with the following content:

    <!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 3</title>
    </head>

    <body>

    <script type="text/javascript" src="test.php"></script>

    </body>

    </html>

    I expected to see the same, as I am basically just calling the previous php code from another php file. Nothing. Just a white page. Saving and calling it as an htm file does not change a thing. Why is that? Where am I doing something wrong? I can't figure it out. Help!!!

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

    Default

    In the case of:

    Code:
    <script type="text/javascript" src="test.php"></script>
    The contents of test.php has to be such that it outputs valid JavaScript code in order for you to see anything on the page, such as:

    Code:
    echo "document.write(\"Hi there\")";
    Back to the original topic though, it would really be helpful if you could post a test page online, as this is something that we need to see live to debug.
    DD Admin

  9. #9
    Join Date
    Aug 2009
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by ddadmin View Post
    In the case of:

    Code:
    <script type="text/javascript" src="test.php"></script>
    The contents of test.php has to be such that it outputs valid JavaScript code in order for you to see anything on the page, such as:

    Code:
    echo "document.write(\"Hi there\")";
    Back to the original topic though, it would really be helpful if you could post a test page online, as this is something that we need to see live to debug.
    Thanks for the tip, but still -- nothing.

    I will see what I can do about the test page. I'll let you know when I have something. Thanks for the offer to help.

  10. #10
    Join Date
    Aug 2009
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by nunofyer bzness View Post
    Thanks for the tip, but still -- nothing.

    I will see what I can do about the test page. I'll let you know when I have something. Thanks for the offer to help.
    OK, I just posted the code to a web site (www.bestrmvacation.com/album.htm), and IT WORKS THERE. It does NOT work on my installation of PHP/Apache. After some snooping on the internet, I turned on some more error reporting and I find the following errors in the error log:

    [Tue Aug 25 17:45:53 2009] [error] [client 127.0.0.1] PHP Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Denver' for '-6.0/DST' instead in C:\\webdev\\rmv3\\album\\getalbumpics.php on line 12, referer: http://localhost/album.php

    [Tue Aug 25 17:45:56 2009] [error] [client 127.0.0.1] File does not exist: C:/webdev/rmv3/favicon.ico

    (The first warning is repeated for each image that I have in the folder). Any suggestions?

    Thanks.

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
  •