PDA

View Full Version : PHP Photo Album Script



rtcook
03-22-2006, 11:16 PM
I really would like to use this, but it does not work for me. I get a blank page with two errors that say "galleryarray" is undefined and one syntax error on line 2. I can't figure it out. Can anyone help?

Thanks,

Roger

Samsoske
03-22-2006, 11:40 PM
Did you do this step in the installation of your PHP photo album:


Step 1: Download "getpics.php" (right click, and select "Save As"), and be sure to remove the .txt extension at the end upon downloading! Then, upload this file to the SAME directory on your server containing all the images you wish the Photo Album script to display, for example, http://www.mysite.com/gallery/. This PHP script will get the file names of all images within this directory, and return it back to the Photo Album script to use to display.


Is this the album you used?

If not, tell me the album you dowloaded, and maybe i can figure it out for you...//

rtcook
03-23-2006, 09:55 PM
Yes, I did do that step. The file is now a PHP extesion file and not a TXT file. I am not sure of what you mean by is this the album I used? I used pictures from my own website folder. Here is the link to my home page:

http://users.adelphia.net/~rtcook/index.htm

Click on the Gallery link. You will see it takes you to a blank page. Right click and check the source code. You will see that I have things right. Also you will see the page load error.

Thanks,

Roger

Twey
03-23-2006, 10:08 PM
http://users.adelphia.net/~rtcook/gallery/getpics.php
This isn't being parsed. Your server apparently does not support PHP.

rtcook
03-23-2006, 10:36 PM
Pardon my ignorance, but what does parsed mean?

Thanks,

Roger

jscheuer1
03-23-2006, 10:42 PM
Parsed means basically read. The server isn't reading it. At least that is what it means, what Twey was saying. But, perhaps something else is wrong. Does your server support PHP? If so, there is some other problem, if not, your out of luck unless you can get your host to turn it on for you or get a different host that offers PHP support.

rtcook
03-23-2006, 10:53 PM
I have Adelphia Cable as my service provider. How can I tell if the servers allow PHP code? Do I need to call them? It wouldn't be anything I need to change on my end would it?

Thanks,

Roger

jscheuer1
03-23-2006, 10:59 PM
Generally, if you go over your user interface with them (my account, etc.) there either will be or will not be an option to turn on PHP support for a particular domain or it will simply list if that support is a part of your current package for that domain or not. Since you have a tilda (~) address to begin with, most likely it is a situation where the support is either a part of the package or not. If it is free web space that comes with a broadband connection, most likely not but you can ask them (it might be included) or if there is an upgrade to PHP and how much additional, if any.

rtcook
03-24-2006, 12:11 AM
Yep, that seems to be the problem. PHP is not supported on my basic web package I got with my cable modem service. I did see it was available in another package that has an additional montlhy charge. It describes PHP as having to do with emailing somebody when the code is run. Why is this? Is the person the wrote the code trying to accumulate data on who is using it? Is it possible to to make this nice program/code work without the PHP? I have really been looking for something like this. I think it would be great just to dump a bunch of photo in a folder, upload it and have the webpage just show the thumbnails. It eliminates all the coding or running of programs to create the web page. Anybody have any thoughts on this?

Thanks,

Roger

jscheuer1
03-24-2006, 02:37 AM
Well, using javascript alone, it is possible to assemble all the images in a directory for processing by a script only if there is a commonality to the filenames involved. Say every image is 1.jpg through 999.jpg, something like that. Many image processing programs will rename or make renamed copies of your images that are numbered like that. Other server side languages (if available) might be able to be used in a similar fashion to the PHP version but, I am a novice at all server side languages so someone else would probably have to help you there if you have another server side language available.

Using javascript as I outlined would go something like this:


<script type="text/javascript">
var pics=new Array()
for (var i_tem = 0; i_tem < 1000; i_tem++)
pics[i_tem]="images/"+i_tem+".jpg"
</script>

This would assemble an array of images 1 through 999.jpg from the images folder for use elsewhere in a script as the variables pics[0] through pics[999]. The 1000 in red can be set to whatever is one more than the total number of images.

Twey
03-24-2006, 09:36 AM
It describes PHP as having to do with emailing somebody when the code is run.PHP is a server-side language. Sending emails is only one of its many uses.

ethereal
03-24-2006, 12:08 PM
Yep, that seems to be the problem. PHP is not supported on my basic web package I got with my cable modem service. I did see it was available in another package that has an additional montlhy charge. It describes PHP as having to do with emailing somebody when the code is run. Why is this? Is the person the wrote the code trying to accumulate data on who is using it? Is it possible to to make this nice program/code work without the PHP? I have really been looking for something like this. I think it would be great just to dump a bunch of photo in a folder, upload it and have the webpage just show the thumbnails. It eliminates all the coding or running of programs to create the web page. Anybody have any thoughts on this?

Thanks,

Roger

Hey Roger,

You may also want to look at this
<script src="http://users.adelphia.net/~rtcook/gallery/getpics.php" type="text/javascript"></script> line in your gallery htm. Be sure that it is the correct path. If you don't have a directory "gallery" then the getpics.php is in the wrong place. Just a thought.

Twey
03-24-2006, 04:10 PM
It is the correct path, I've already checked. Lack of PHP support is the only problem here.

Linux! The OS of the FUTURE!!!I'd disagree here. In the not-too-distant future, I should hope that people will start to develop software for microkernel-based distributions, like GNU Hurd. :)

Chris Chambers
05-11-2006, 01:32 PM
I really would like to use this, but it does not work for me. I get a blank page with two errors that say "galleryarray" is undefined and one syntax error on line 2. I can't figure it out. Can anyone help?

Thanks,

Roger


I am getting the same error, I am trying to debug and test my site on my local Machine, I am using frontpage 2003 on a Windows XP Pro, SP 2 operation system

is there a way to do this with out using a ISP, so that i can test the images and code before I upload it all onto a ISP.

Twey
05-11-2006, 02:46 PM
is there a way to do this with out using a ISP, so that i can test the images and code before I upload it all onto a ISP.This is (in part) a server-side script; it must be running on a PHP-enabled webserver. You can install and setup such a webserver on your home computer; this will then be able to run the script.