[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details

HTML file linked to cgi perl file won't use the .pl file without trying to save the file to the hard drive

Asked by theromanone in CGI Scripting, Hypertext Markup Language (HTML), Perl Programming Language

Tags: perl, cgi, html, .pl, .html

Trying to make a simple HTML file to run in a web browser that allows user to enter a dna sequence, click on "submit", and have the html file use the perl program to do the data-crunching and report back to the html file to output on the same screen.

Problem is, when the "submit" button is clicked, it's as if the browser thinks i'm trying to download the .pl file instead of using it. The .pl file is probably not even done, but would that not at least give me an error, instead of trying to save the file? I'd appreciate any help, I'm new at this!





PS: The final product is supposed to look like this:

The sequence you entered is: ATGCN
A=1
T=1
G=1
C=1
N=1
GC content=40%
Click Assignment 2 to try another sequence analysis.

#the assignment 2 links back to the same site so users can enter in a new sequence, and hash is used to count the sequence (of which I am also not totally sure how to do)
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
Here is the html code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
<head>
    <title>Form Example</title>
</head>
<body>
    <!-- Insert your content here -->
    <form action="/gagejd_assign3.pl" method="POST">
    Please enter your sequence:  <input type="text" name="userseq" /><br />
    <input type="submit" name="submit" value="Submit" />
<BR>
<BR>
        <a href=/gagejd_assign3.html>Click Assignment 2 to try another sequence analysis.</a>
    </form>
</body>
</html>
 
 
 
 
And here is the CGI perl file:
 
#!/usr/bin/perl -w
use strict;
use CGI;
my $cgi=new CGI;
 
print $cgi->header();
print $cgi->start_html(-title=>'Form Results',
-author=>'Julian Gage');
 
my $seq=$cgi->param("userseq");
$seq=uc($seq);
my $len=length($seq);
my $count_a=0;
my $count_t=0;
my $count_g=0;
my $count_c=0;
my $count_n=0;
 
$count_a=($seq=~tr/A/a/);
$count_t=($seq=~tr/T/t/);
$count_g=($seq=~tr/G/g/);
$count_c=($seq=~tr/C/c/);
$count_n=($seq=~tr/N/n/);
 
print ("[Sequence that you entered is:]=($seq)<br>");
print ("[The sequence length:]=($len)<br>");
print ("[A count]=($count_a)<br>");
print ("[T count]=($count_t)<br>");
print ("[G count]=($count_g)<br>");
print ("[C count]=($count_c)<br>");
print ("[N count]=($count_n)<br>");
 
print (<a href=\. ./formEasy0.html \''> click here to continue</a>'');
print $cgi->end_html."\n";
[+][-]10/16/09 02:55 PM, ID: 25593674Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/16/09 02:56 PM, ID: 25593679Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/16/09 02:57 PM, ID: 25593690Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-89 - Hierarchy / EE_QW_3_20080625