![]() |
I put in a script and can't access a certain area due to the need to put in the full path to the file... Is there an easy way to find out the full path on a server without waiting to ask the hosting support?
|
Hmm been a while since I did this but if memory serves me correctly...
If you have SSH/Telnet access to the server, you can login, cd to the directory in question and then type: pwd That should tell you the full path of where you are. I'm sure one of the real tech gurus will shout me down if I'm wrong. :) |
I think I understand. If it is a linux box you can use the whereis command.
ie: whereis "filename" with "filename" being the file you want to see the path for. |
I don't have shell access
I need the part of the path that is before the cgi-bin directory which is in the root of my account |
#!/usr/bin/perl
print "Content-type: text/html\n\n"; open(PWD,'pwd|'); $pwd = join('',<PWD>); $pwd =~ s/\n//gi; close PWD; print "Current working directory: $pwd "; |
Quote:
|
Most FTP clients will let you run a "PWD".
FTP in, change to the directory in question and execute PWD via FTP. in WS_FTP for instance it would be File->Operations->PWD |
Create a file. Name it "info" without the quotes.
Put cd34's code in it. Place this file in your cgi-bin. Chmod it 755 Point your web browser to it, like this http://terrizamore.com/cgi-bin/info |
Quote:
|
Quote:
|
Did you chmod 755 it?
You can give it the extension of .cgi if your server needs it. |
Quote:
added the extention and still get server error :( |
Make sure that you have cd34's code exactly without any html tags, no body and head tags etc.
Maybe this isn't where Perl is located on your server. #!/usr/bin/perl Try #!/usr/local/bin/perl You can also try .pl for the extension. |
Quote:
|
can you give us a url or ip so we can try to find out what kind of box is it? cause if perl did not work by default you may not have that enabled or you are on a windblows box (which i doubt)
|
Quote:
|
http://www.adulttemplete.com/server.zip
this zip has a .cgi file setting to 777 in the cgi bin and then open it in a browser and the info is there the php file can be used anywhere else |
|
Done :)
|
Quote:
|
Thanks I should have been more on the ball :)
|
Quote:
|
hummmmmmm just deleted and reloaded then downloaded and checked it should work now if not hit me up on icq and i'll mail them to you
|
Quote:
nice script... :rokk: |
| All times are GMT -4. The time now is 05:41 PM.. |
Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Copyright Evil Empire Inc. 2006-2022