View Full Version : Anybody know perl?
bigperm
April 30th, 2001, 15:24
I was wondring how hard it would be for a perl script to do this... Say I have all of my html files in one directory, called html. Could I have a script that was like html.cgi?no=14 and then have it pull up 14.html? Also have one like that for pics? Like pic.cgi?no=54 and then get 57.gif/jpeg?
I would really like to know how to do this in perl, but if not, I could always do it in php...
BillWill
April 30th, 2001, 18:20
Well, you could, very easily in fact, but why would you want to do that? If you already have to go thru the trouble of making all the HTML files why not just link to those? =P
Besides most search engines hate dynamic content (?, &, = in URL).
bigperm
April 30th, 2001, 18:42
Well, my site is planning on having a lot of content, and I think that would be the best way to do it. Instead of naming each individual file, it would just have a number. That way it would also be easier to know which was put up first.
I don't know... for some reason I want to be able to do that. I don't really care about search engines. So if anybody could direct me to a script that does that, or one that could easily set up to do that, I would appreciate it.
Canuckkev
April 30th, 2001, 22:33
Well, I have something like that on my page. I have one script, view.cgi, and I call the image by having this: view.cgi?file=filename&dir=directory . Then on the page, it loads the image <img src="filename.jpg">, and use perl to open up a text file, to add a caption to it. And have a default header and footer for all pages. So, you wont have to make all the html pages if they have basically the same layout, just make a caption file. It saves a lot of time. Maybe not so much because I only have 9 images..., but it makes expanding much easier. Tell me if this sounds like what you need. I'll send it to you after I clean up the coding and comment it and stuff like that.
bigperm
May 1st, 2001, 12:02
That would be super.
Canuckkev
May 1st, 2001, 18:24
http://www.3dflux.f2s.com/view.txt should work. I hope you don't get lost in it. Just rename it to a .cgi or .pl, upload, chmod to...I don't know...755 should work. Don't forget to change the first line to th correct path to perl on your server.
bigperm
May 1st, 2001, 19:41
thanks I'll try it.
Powered by vBulletin® Version 4.1.7 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.