The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
help for a perl script - writing to a data file meghana Shell Programming and Scripting 2 02-04-2008 02:05 PM
Perl Unix Script Writing Dinkster UNIX for Dummies Questions & Answers 1 02-01-2008 01:09 PM
Reading and Writing from Excel using Unix scripting AshishK UNIX and Linux Applications 3 11-08-2007 11:49 PM
Perl Scripting vaibhav Shell Programming and Scripting 10 03-27-2007 02:32 AM
Writing perl module jo_aze Shell Programming and Scripting 4 08-06-2003 08:10 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 04-22-2007
Registered User
 

Join Date: Apr 2007
Posts: 10
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
Reply With Quote
Forum Sponsor
  #2  
Old 04-22-2007
Registered User
 

Join Date: Jan 2007
Posts: 28
Post 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
Reply With Quote
  #3  
Old 04-23-2007
Registered User
 

Join Date: Apr 2007
Posts: 10
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
Reply With Quote
  #4  
Old 04-23-2007
Moderator
 

Join Date: Sep 2002
Location: Hong Kong, China
Posts: 1,477
For mod_perl, you have set the script executable, right? Also check Apache error log for more hints.
Reply With Quote
  #5  
Old 04-23-2007
Registered User
 

Join Date: Apr 2007
Posts: 10
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
Reply With Quote
  #6  
Old 04-23-2007
Moderator
 

Join Date: Sep 2002
Location: Hong Kong, China
Posts: 1,477
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?
Reply With Quote
  #7  
Old 04-23-2007
Registered User
 

Join Date: Apr 2007
Posts: 10
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
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 05:19 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0