CGI Script
Question posted by: jain236
(Member)
on
July 3rd, 2008 09:52 AM
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
Code: ( text )
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;
Thanking you in advance
Would you like to answer this question?
Sign up for a free account, or Login (if you're already a member).
|
|
July 3rd, 2008 02:32 PM
# 2
|
Re: CGI Script
Your script should be inside the cgi-bin directory which is a special directory to run the perl script.
Regards
Rajiv
|
|
July 3rd, 2008 04:18 PM
# 3
|
Re: CGI Script
Sounds like the server is not setup correctly. Check to make sure that you have enable it to run CGI scripts.
--Kevin
|
|
July 4th, 2008 07:22 AM
# 4
|
Re: CGI Script
Quote:
Originally Posted by eWish
Sounds like the server is not setup correctly. Check to make sure that you have enable it to run CGI scripts.
--Kevin
|
Exactly..kevin.. i have made the changes.. thannx for you help
Not the answer you were looking for? Post your question . . .
180,430 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).
|
|
|
Top Perl Forum Contributors
|