domuk
01-29-2004, 01:41 PM
Hi all,
I this the simplest CGI program that can be written?
I placed it in the cgi-bin, checked the file permissions and tried various combinations on the file and folder
Folder (755)(775)(750)
File (755)(775)(750)
__file: hello.cgi___(upload in ASCII using smarrtFTP)_______
#!/usr/bin/perl
print "Content-type: text/html\n\n" ;
# Print the HTML response page to STDOUT
print <<EOF ;
<html>
<head><title>CGI Results</title></head>
<body>
<h1>Hello, world.</h1>
</body>
</html>
EOF
exit ;
(file from http://www.jmarshall.com/easy/cgi/cgi_footnotes.html#samples)
I then called the file from within a html document on my desktop
various ways:
<a href="http://www.websiteaddress.co.uk/myftpusername/cgi-bin/hello.cgi">my link </a>
<a href="http://www.websiteaddress.co.uk/cgi-bin/hello.cgi">my link </a>
I also changed the file to hello.pl and tried the following link:
<a href="http://www.websiteaddress.co.uk/cgi-bin/hello.pl">my link </a>
I then tried a simple text file with a few words in it:
<a href="http://www.websiteaddress.co.uk/cgi-bin/hello.txt">my link </a>
I have looked at other sites hosted by www.easily.co.uk to try and look at how they have called a cgi program, here is an example:
<A HREF="http://www.z2group.co.uk/binbghwp0akf/cgi-bin/message/ubbmisc.cgi?action=setprefs"> other easly link
</a>
Nothing has worked and I am getting very frustrated. I have bin through numerous tutorials on CGI and file permissions and think I understand how to change them.
I am using smart FTP and for a file right click on the file, select CHMOD and type the number in then close it down. When you next open the program it appears to have worked changed.
To change a folder I have been typing “site chmod 755 /cgi-bin/” and the on screen appears to be working. then I close it down and when I next enter it appears to have changed.
Don’t know how to access the servers error log, any ideas?
Where and how do you enter this code to check for errors "perl -cw myscript.cgi".
How do I find the perl interpreter with the Unix command "which perl" in smartFTP?
I have tried both of these paths to perl:
#!/usr/local/bin/perl
#!/usr/bin/perl
I am on phobos server. Are the settings for this server standard throughout the web or will they be specific to easily?
The technical help keeps coming back with “we do not offer coding support”. They originally gave me duff path information when I was setting up .htaccess files. I suspect that it I am missing some vital server / configuration / path information. I just do not know what else to try.
Have I missed anything?
I can not help thinking that it took me 10 min to get the .htaccess files working when they eventually gave me the correct information. Prier to this I had been struggling for days.
Please Please help,
thanks again,
Dom.
I this the simplest CGI program that can be written?
I placed it in the cgi-bin, checked the file permissions and tried various combinations on the file and folder
Folder (755)(775)(750)
File (755)(775)(750)
__file: hello.cgi___(upload in ASCII using smarrtFTP)_______
#!/usr/bin/perl
print "Content-type: text/html\n\n" ;
# Print the HTML response page to STDOUT
print <<EOF ;
<html>
<head><title>CGI Results</title></head>
<body>
<h1>Hello, world.</h1>
</body>
</html>
EOF
exit ;
(file from http://www.jmarshall.com/easy/cgi/cgi_footnotes.html#samples)
I then called the file from within a html document on my desktop
various ways:
<a href="http://www.websiteaddress.co.uk/myftpusername/cgi-bin/hello.cgi">my link </a>
<a href="http://www.websiteaddress.co.uk/cgi-bin/hello.cgi">my link </a>
I also changed the file to hello.pl and tried the following link:
<a href="http://www.websiteaddress.co.uk/cgi-bin/hello.pl">my link </a>
I then tried a simple text file with a few words in it:
<a href="http://www.websiteaddress.co.uk/cgi-bin/hello.txt">my link </a>
I have looked at other sites hosted by www.easily.co.uk to try and look at how they have called a cgi program, here is an example:
<A HREF="http://www.z2group.co.uk/binbghwp0akf/cgi-bin/message/ubbmisc.cgi?action=setprefs"> other easly link
</a>
Nothing has worked and I am getting very frustrated. I have bin through numerous tutorials on CGI and file permissions and think I understand how to change them.
I am using smart FTP and for a file right click on the file, select CHMOD and type the number in then close it down. When you next open the program it appears to have worked changed.
To change a folder I have been typing “site chmod 755 /cgi-bin/” and the on screen appears to be working. then I close it down and when I next enter it appears to have changed.
Don’t know how to access the servers error log, any ideas?
Where and how do you enter this code to check for errors "perl -cw myscript.cgi".
How do I find the perl interpreter with the Unix command "which perl" in smartFTP?
I have tried both of these paths to perl:
#!/usr/local/bin/perl
#!/usr/bin/perl
I am on phobos server. Are the settings for this server standard throughout the web or will they be specific to easily?
The technical help keeps coming back with “we do not offer coding support”. They originally gave me duff path information when I was setting up .htaccess files. I suspect that it I am missing some vital server / configuration / path information. I just do not know what else to try.
Have I missed anything?
I can not help thinking that it took me 10 min to get the .htaccess files working when they eventually gave me the correct information. Prier to this I had been struggling for days.
Please Please help,
thanks again,
Dom.