f********u 发帖数: 572 | 1 it's my first time writing CGI using Perl. I have
the HTML form page ready. But whenever I submit
my form, I get the webpage of the text of the CGI
program itself. What's wrong I am doing here? How
to make it work? Two things I am not sure about..
1. does a CGI program has a required extension, say hello.cgi
or no extension at all or I can just have hello.pl ?
2. do I need to compile? It seems I can not compile like
what I do to a perl script. It gets strange html contents
onto the scre |
D****g 发帖数: 2860 | 2 make sure it's executable, and it's under the cgi-bin dir.
【在 f********u 的大作中提到】 : it's my first time writing CGI using Perl. I have : the HTML form page ready. But whenever I submit : my form, I get the webpage of the text of the CGI : program itself. What's wrong I am doing here? How : to make it work? Two things I am not sure about.. : 1. does a CGI program has a required extension, say hello.cgi : or no extension at all or I can just have hello.pl ? : 2. do I need to compile? It seems I can not compile like : what I do to a perl script. It gets strange html contents : onto the scre
|
f********u 发帖数: 572 | 3 it has to be in the cgi-bin dir? and I can mk this cgi-bin
dir anywhere? or must be somewhere like /usr/bin/ ??
thanks ..and executable...em...do i need to have chmod +x
myself? i thought perl does that...or you mean i have to do
something else to make it executable? thanks a lot...
【在 D****g 的大作中提到】 : make sure it's executable, and it's under the cgi-bin dir.
|
D****g 发帖数: 2860 | 4 you need to do chmod a+x.
as to cgi-bin, it depends on your http server. you might want to lookup the
document
【在 f********u 的大作中提到】 : it has to be in the cgi-bin dir? and I can mk this cgi-bin : dir anywhere? or must be somewhere like /usr/bin/ ?? : thanks ..and executable...em...do i need to have chmod +x : myself? i thought perl does that...or you mean i have to do : something else to make it executable? thanks a lot...
|
f********u 发帖数: 572 | 5 its too bad..I have made the dir into cgi-bin and I executed the
chomd a+x and it still does not work...what shall I do now? I
have a perl book with CGI at hand. I have tried its example because
mine does not work. but his neither. i thought maybe our platform
does not have CGI.pm, so I changed to another Solaris and another
Linux. I believe at least one of them should make it work if there
is nothing wrong with the program. but it does not..So I am thinking
there must be something else that I a
【在 D****g 的大作中提到】 : you need to do chmod a+x. : as to cgi-bin, it depends on your http server. you might want to lookup the : document
|
D****g 发帖数: 2860 | 6 well, it seems to me that your http server is not properly configured.
are you using apache? I'm not familiar with these stuffs at all, but I suggest
you do the following:
1. read the document of the http server.
2. test if you can execute the cgi program from a shell.
3. check in the html wheter the ACTION string contains a "?"
4. make sure the first line of the perl script contains #!/bin/perl (or
wherever perl is).
if still not working, then wait for some guru to answer your question :),
sor
【在 f********u 的大作中提到】 : its too bad..I have made the dir into cgi-bin and I executed the : chomd a+x and it still does not work...what shall I do now? I : have a perl book with CGI at hand. I have tried its example because : mine does not work. but his neither. i thought maybe our platform : does not have CGI.pm, so I changed to another Solaris and another : Linux. I believe at least one of them should make it work if there : is nothing wrong with the program. but it does not..So I am thinking : there must be something else that I a
|
p******f 发帖数: 162 | 7
You didn't mention your http server or platform, but your Q1
really depends on the server configuration. As for Q2, I don't
think it is necessary to compile the perl script.
【在 f********u 的大作中提到】 : it's my first time writing CGI using Perl. I have : the HTML form page ready. But whenever I submit : my form, I get the webpage of the text of the CGI : program itself. What's wrong I am doing here? How : to make it work? Two things I am not sure about.. : 1. does a CGI program has a required extension, say hello.cgi : or no extension at all or I can just have hello.pl ? : 2. do I need to compile? It seems I can not compile like : what I do to a perl script. It gets strange html contents : onto the scre
|
f********u 发帖数: 572 | 8 thank you so much!. thanks all so much. Yes, I think I found the
problem with the help from all of you. :) I need the administrator
to set the httpd.conf in order to have my cgi-bin dir executable.
I have not got it work yet. but I am pretty sure that 's the problem.
Thanks a lot! :)
【在 D****g 的大作中提到】 : well, it seems to me that your http server is not properly configured. : are you using apache? I'm not familiar with these stuffs at all, but I suggest : you do the following: : 1. read the document of the http server. : 2. test if you can execute the cgi program from a shell. : 3. check in the html wheter the ACTION string contains a "?" : 4. make sure the first line of the perl script contains #!/bin/perl (or : wherever perl is). : if still not working, then wait for some guru to answer your question :), : sor
|