how to list files in directory or generate links for files in a directory
Basic questions here. I don't really know anything about this stuff. I had a 129 text files that I maually made 129 html links for like this:
Code:
<p class="note">(Updated: 7/30/15)</p> I assumed there was a smart way to do it but I didn't know what it was so I did it that way. Alright, those text files just contain the output of a dir > sinks.txt command on a dos box so guys can see if we already have a sink dxf drawing or if they need to bring the sink back. But now they want to be able to look at the actual .dxf's on their phones. Well I ftp'd all the dxf's to my website but if there's 100's and 100's of .dxf files I don't want to manually program links for each one. So: 1) I assume there's a way to get your webpage to just display the contents of a directory and make everything clickable instead of this: http://www.darkswamp.com/sinks/dxfs/ 2) But if I want my links all to look fancy like this: http://www.darkswamp.com/sinks.html then isn't there a way to make the web page generate the links with java or php or something? Or even html? I guess if somebody could just tell me what to read that would help. I don't want to dive into php when the answer was html. |
It don't have to be PHP, it can be shell CGI. Something like this:
Code:
... |
thx. Sounds good.
|
I wrote this and compiled it and uploaded it but it doesn't work:
http://www.darkswamp.com/cgi/fun.cgi Code:
#include <stdio.h> https://www.godaddy.com/help/which-p...rt-with-cgi-26 If I compiled it on Fedora then isn't it compiled specifically to run under the linux operating system? I guess I can figure out shell scripting or figure PHP out but it would be nice if I could just use C since it's all I know. |
Been messing with a shells script instead. Same error.
Well I enabled error logs and read this: AH01215: suexec policy violation: see suexec log for more details So then I found this page and tried messing with permissions. I did it through gftp. http://www.pranavpc.com/2010/12/solu...some-webhosts/ But I removed the wrong permissions and now I don't even have permission to enable permissions. *edit, i can use ssh and change it there. |
You should login into the web-server (via ssh, most likely), and check the content of files /var/log/apache2/error_log and /var/log/apache2/suexec_log; also check if your file is executable on that system (hopefully you used 'binary' mode when transferred the file). (You should quote the output 'ls -l /somepathwereitis/yourcgi')
|
Yay!:
http://www.darkswamp.com/cgi/whatever.cgi I had to use ssh and do a chmod 755 I don't think the permissions in gftp work, at least not with my website. I mean if I alter them with chmod through ssh then the changes are not reflected when I pick permissions through gftp. But whatever, I'll just use ssh. |
Yes! The C one works now too! Thanks, man:
http://www.darkswamp.com/cgi/fun.cgi |
All times are GMT -5. The time now is 09:27 PM. |