Hi every body,
i am just new to the CGI scripting.
i am trying to run a basic CGI script . i am using APACHE as my web server .
i have placed my basic script inven.cgi in the web server and when i am trying to access my script with http://mydomain/inven.cgi
instead of getting the functionality of the script , i am seeing the whole script code on the web page.Do i need to do any setting to run the CGI script?
here is the code which i used
Thanking you in advance
i am just new to the CGI scripting.
i am trying to run a basic CGI script . i am using APACHE as my web server .
i have placed my basic script inven.cgi in the web server and when i am trying to access my script with http://mydomain/inven.cgi
instead of getting the functionality of the script , i am seeing the whole script code on the web page.Do i need to do any setting to run the CGI script?
here is the code which i used
Code:
use CGI qw/:standard/;
print header,
start_html('A Simple Example'),
h1('A Simple Example'),
start_form,
"What's your name? ",textfield('name'),p,
"What's the combination?", p,
checkbox_group(-name=>'words',
-values=>['eenie','meenie','minie','moe'],
-defaults=>['eenie','minie']), p,
"What's your favorite color? ",
popup_menu(-name=>'color',
-values=>['red','green','blue','chartreuse']),p,
submit,
end_form,
hr;
if (param()) {
my $name = param('name');
my $keywords = join ', ',param('words');
my $color = param('color');
print "Your name is",em(escapeHTML($name)),p,
"The keywords are: ",em(escapeHTML($keywords)),p,
"Your favorite color is ",em(escapeHTML($color)),
hr;
}
print end_html;
Comment