Writing CGI scripting using perl


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Writing CGI scripting using perl
# 1  
Old 04-23-2007
Writing CGI scripting using perl

Hi All,

I am trying to do the following thing.
I am entering name & email id & then in action i am calling a .cgi program that sends a email to the email id entered.
I am facing a small problem, once i have entered the details , its printing the contents of .cgi file in browser. there is a subroutine in program which prints the thank you note. it should give me that.

can anyone let me know where i went wrong.?


Thanks in advance.

Alma
# 2  
Old 04-23-2007
Java HTTP Server status

As far as i know, this happens only under two situations:
- http server may not be running.
- cgi is not supported (i dont think this is common)

Thanks
Srini
# 3  
Old 04-23-2007
I have restart my apache server .

I could find these enteries in the
#set Apache::PerlRun Mode for /cgi-perl Alias
<Location "/cgi-perl/*.pl">
SetHandler perl-script
PerlResponseHandler ModPerl::PerlRun
Options -Indexes ExecCGI
PerlSendHeader On
</Location>


how can i know the cgi is not supported ?

Thanks
Alma
# 4  
Old 04-23-2007
For mod_perl, you have set the script executable, right? Also check Apache error log for more hints.
# 5  
Old 04-23-2007
CGI Script - Not getting form value

My code is a.html
<html>
<head>
<title></title>
<body>
<form name=name form method=post action=http://localhost/cgi-bin/b.cgi>
enter your name:<input name=name type=text><br>
<input type=submit>
</form>
</body>
</html>

b.cgi
#!/perl/bin/perl5.6.1.exe
use strict;
use CGI qw(:standard);
my $name=param("name");
print "Content-Type:text/html\n\n";
print $name;

But i am not getting the value in it.

Thanks Alma
# 6  
Old 04-23-2007
Server is displaying source code because either there are problems with your mod_perl configuration, or your script is not properly installed (without +x chmod, lack of access permission, etc.), etc.

And your Apache configuration suggests you are not running Apache CGI (at least that's not what you quoted). You are running mod_perl.

Try changing the extension from .cgi to .pl and see if it helps. And did you actually give an executable chmod?
# 7  
Old 04-23-2007
Link html & cgi scripts

Yes it working fine now .
Thanks for the needed help.

There is a small query to raise.

I have a subscription html & subscription.cgi. On filling the subscription form , in action subscription. cgi will work n save the entered details . Once its filled then it should display another html page saying subscribed.

I have the html ready, i need to link them .
something like once subscibtion form is filled it need to display the subscribed .html & then to the Login page ..

meanwhile the data is stored using subscribed.cgi.

I am not sure how can i link these html n cgi ?

I will appreciate for the help..

Thanks
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. OS X (Apple)

Perl CGI

I am trying to get my MacBook Pro with 10.8 Mt Lion set up to run Perl CGI scripts. Having a problem. I can start Apache Web Server with no problems. Why do I put the static and dynamic scripts? I which directory? I have looked at this article:... (3 Replies)
Discussion started by: djehresmann
3 Replies

2. Shell Programming and Scripting

CGI Perl : while loop in CGI perl

Hi Team, I am trying to connect to database(succeeded ) and print the records on the browser using while loop. But the elements of array are not displayed instead while loop is displayed directly. Instead of the below I can embed html statements in print but I am looking for the below style as I... (1 Reply)
Discussion started by: scriptscript
1 Replies

3. Shell Programming and Scripting

Perl CGI : unable to download the excel sheet from perl cgi page

Hi All, I have written an cgi perl script that displays an image(Excel image) and when clicked on that Image I need to download a excel sheet. I made sure that excel sheet exists in the folder with the given name but still I am not able to download the sheet. print "<center><table... (2 Replies)
Discussion started by: scriptscript
2 Replies

4. Shell Programming and Scripting

Perl cgi pages out of cgi-bin folder in WINDOWS

Hi team, I have a typical problem with cgi pages in apache webserver in WINDOWS I am able to execute(display) the pages that are saved in cgi-bin folder. But I am not able to execute the pages stored in htdocs or other folder other than cgi-bin folder. Could anyone please let me know how... (1 Reply)
Discussion started by: scriptscript
1 Replies

5. Shell Programming and Scripting

Web Service in Perl CGI scripting

Hi, I have a requirement to write web service in Perl CGi scripting.The web service will be called by some external programs.Any help would be appreciated.Sample hello world program will be more helpful. Thanks, Liyakath Ali. (1 Reply)
Discussion started by: liyakathali
1 Replies

6. Shell Programming and Scripting

Perl CGI Scripting

Hi, My below cgi script works fine from the command line but not working from the web browser. #!/usr/bin/perl use File::Copy; use CGI; print "Content-type: text/html\n\n"; print "<html><head><title>LOGS"; print "</title></head>"; print "<body bgcolor=#95B9C7 link=black>"; ... (4 Replies)
Discussion started by: liyakathali
4 Replies

7. Web Development

problem with exporting vairable from one perl cgi to another perl cgi script while redirecting.

Can anyone tell me how to export a variable from one perl CGI script to another perl cgi script when using a redirect. Upon running the login.pl the user is prompted to enter user name and password. Upon entering the correct credentials (admin/admin) the user is redirected to welcome page. My... (3 Replies)
Discussion started by: Arun_Linux
3 Replies

8. Shell Programming and Scripting

CGI scripting Error

I am trying to execute following program #!/usr/bin/perl -wT use CGI qw(:standard); print start_html("Hello world"); and getting an error (offline mode: enter name=value pairs on standard input) i am a beginner so please try to explain it as much as possible. ---------- Post updated... (4 Replies)
Discussion started by: bhavesh.sapra
4 Replies

9. Shell Programming and Scripting

cgi scripting help needed

hi all, i'm new to CGI scripting. I want to compute memory utilisation, so when i run free command in my cgi scipt, if memory is utlised more than 70%. i want to display in free command in html as red color free total used free shared buffers ... (1 Reply)
Discussion started by: raghur77
1 Replies
Login or Register to Ask a Question