avatar
f*u
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
avatar
D*g
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

avatar
f*u
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.
avatar
D*g
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...

avatar
f*u
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

avatar
D*g
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

avatar
p*f
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

avatar
f*u
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

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。