View Full Version : Need help with *PL files !!
Jonathan
January 5th, 2001, 04:55
Please, I have this serious problem with my website. Each time that I want to place a link to a page to show a link, I have to create each HTML file individually, which is time-consuming and takes more space on my server.I have seen that in other websites, they use *.pl files to solve the problem. They link to a page that goes like this:
http://www.whatever.com/pictures/pics.pl?nameofpic.jpg
I have tried programming *.PL files but it just hasn't worked out. I really need your help. I hope somebody can help me. I wait for your answer...
THANKS A LOT!!!
neon
January 5th, 2001, 05:10
I am not sure if I fully understand what you want but in your example link you are using a link to link to a picture if that is what you are wanting to do then all you have to do is put all of your pictures in one directory and on the page you are calling them from just change the name of the link to match the pictures location. An example would look like this.
Main page
1st picture http://mysite.com/pics/pic1.jpg
2nd picture http://mysite.com/pics/pic2.jpg
3rd picture http://mysite.com/pics/pic3.jpg
etc...
Obviously you don't put the 1st,2nd,and 3rd picture stuff and what will happen is when you click on the links it will open them up in the directory which is what I think you are trying to do. You can do the same thing with using thumbnails of pictures as the links. I am assuming you already know how to do this so I will not put it on here.
Anyway I hope that is what you are talking about and if so I hope it helps and good luck.
megacool
January 5th, 2001, 05:12
You need a Perl (CGI) script.. Try searching on
http://www.cgi-resources.com
Piclink (a perl script) might do the job too! http://www.cgiscriptcenter.com
cheerz!
Jonathan
January 5th, 2001, 06:05
Thanks guys, but I'm really a newbie to CGI codes. Visit the link below and then you'll see what I need. Just click on a pic and you'll see what it does. I wonder how I can do that. Please, help me!
http://www.katieholmespictures.com/pictures/trl.shtml
Hope you guys can help me...
Jonathan
January 5th, 2001, 06:21
I have found the CGI code I need. I found it where you told me megacool. The code is here:
http://boyden215.ucr.edu/cgi-bin/pp2t.pl/iaw.pl
Now, my question is...
What do I do with the code??
Where do I place it?
What do I do now??
Please help me, I'm a total newbie. You have no idea of how much I will appreciate it.
[Edited by Jonathan on 01-05-2001 at 07:23 AM]
megacool
January 5th, 2001, 13:08
e-mail me jonathan.. i will try to set it up for u.
megacool@visto.com
keith
January 5th, 2001, 18:45
you might try this with php3 too
make an images.php3 document read like this:
<html>
<head>
<title>Title for images page</title>
</head>
<body>
<img src="<?php print "$image" ?>">
</body>
</html>
then link it something like this:
http://www.weezer.com.ru/img/images.php3?image=http://www.weezerfans.com/ikonboard/avatars/admin_1.gif
just make the header and footer html match your page. you kinda need to have php3 enabled on your server though, but it's a lot simpler than cgi or perl, and zero server strain
[Edited by keith on 01-05-2001 at 07:53 PM]
Nick
January 5th, 2001, 19:54
What about:
#!/usr/bin/perl
##############################################
#
# image.pl
#
# upload to cgi foler and chmod 755
#
# call it by http://url.com/cgi-bin/image.pl?filename
# without the file extension. this will only
# work with *.gif's. if you want it to work with
# all images, just remove the *.gif extension below
# and call it like this: by http://url.com/cgi-bin/image.pl?filename.XXX
#
# I just wrote this off the top of my head so
# don't expect a long, well-thought-out script
# ok (:
#
##############################################
# Query String Variable Bull----
$pic = $ENV{"QUERY_STRING"};
print "Content-type: text/html\n\n";
print "<html><head><title>Picture Viewer</title></head>\n";
print "<body bgcolor=\"#FFFFFF\" text=\"#000000\" link=\"#0000FF\" alink=\"#0000FF\" vlink=\"#0000FF\">\n";
print "<font face=\"Verdana, Arial, Tahoma, sans-serif\">\n";
print "Check Out This Pic!<br><br><br>\n\n";
print "<center>";
print "<img src=\"/images/$picid.gif\">\n";
print "</center>\n";
print "</font></body></html>\n";
Hope that helps :D
keith
January 5th, 2001, 22:05
this guy gets cooler by the hour. i like how he uses 'bull----' like he doesn't have a care in the world.
if you're gonna have a lot of images being viewed, php is the way to go. no server resources are used and it's much smaller coding... thus much, much quicker
Nick
January 6th, 2001, 00:25
Originally posted by keith
if you're gonna have a lot of images being viewed, php is the way to go. no server resources are used and it's much smaller coding... thus much, much quicker
Even though I think you're being sarcastic [and I'm to tired to care], PHP is the way to go. I agree 110%; however, He wanted a perl script and the one posted above was much longer and since a perl script must be completely read before it's executed I wrote a smaller one so it would work faster for him.
Jonathan
January 8th, 2001, 00:35
Thanks a lot for your help Kieth, but I just found out that my server does not support PHP files!
Nick: Your code will really help me. I don't know how to install it in my site. If you could please explain to me how to, I would really appreciate it! I really hope you -or someone else- can help me...
Thanks!!!
[Edited by Jonathan on 01-08-2001 at 01:41 AM]
Nick
January 8th, 2001, 01:27
Originally posted by Jonathan
Nick: Your code will really help me. I don't know how to install it in my site. If you could please explain to me how to, I would really appreciate it! I really hope you -or someone else- can help me...
Sure! I'll help you install it. First of all you need to contact your host about the 'path to perl'. Most cases it's #!/usr/bin/perl; however, it could be #!/usr/local/bin/perl. If it is different from my script, change it in your text editor.
The path to the images directory is going to be http://www.your-url.com/images/ so all your images you want viewable must be in this directory!
If they are all GIF's leave the rest alone and you do not have to include '.gif' on the img.pl?image ending, but if some are jpgs, replace $picid.gif with $picid, now you must use it like this: img.pl?image.extension.
Ok. Ready to upload. Put the .pl file in your cgi directory. If you don't have one, make a dire and right click the directory and CHMOD it to 755 (Read/Write/Execute-Read/Execute-Read/Execute). Then upload the .pl file in ASCII MODE (IMPORTANT!). CHMOD it the same as the cgi directory, 755, and you're set!
Jonathan
January 8th, 2001, 15:17
Wow Nick!
You've no idea how thankful I am with you. Ypur help has been really useful and I bet it's going to solve my problem.
You're awesome!
Jonathan
Nick
January 8th, 2001, 17:51
Originally posted by Jonathan
You're awesome!
Yes, yes. I know :p, but it's always satisfying to have someone tell me that ;). Anyway, glad to be of some help :D.
Powered by vBulletin® Version 4.1.7 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.