?
Solved

cgi javascript

Posted on 2005-04-20
4
Medium Priority
?
307 Views
Last Modified: 2013-12-25
i have  following cgi script:

#!/usr/local/bin/perl
use CGI;
print "Content-type: text/html\n\n";
$|=1;

print "<html>
            <Head>
               <SCRIPT>
                     function view() {
                        window.open(\"http://vortex.com/~rshah1/service.cgi\");
                     }
                </script>
            </head>
           

             <BODY bgColor=\"edede2\">
                 <form name=change>
                        <input type=\"Submit\" value=\"Update\" onclick=\"view()\"> </input>
                 </form>
           </html>";

is it possible if someone clicks view button instead of opening a new page service.cgi  can i  call a subroutine within this page.
this is just to prevent creating an additional file
0
Comment
Question by:shahrahulb
2 Comments
 
LVL 48

Accepted Solution

by:
Tintin earned 1000 total points
ID: 13829123
Just get rid of the Javascript and make it a standard HTML with the script handling whatever you have in service.cgi

0
 
LVL 51

Assisted Solution

by:ahoffmann
ahoffmann earned 1000 total points
ID: 13831356
> is it possible if someone clicks view button instead of opening a new page service.cgi  can i  call a subroutine within this page.

simply use following link (better with HTML and not that ugly JavaScript:)

  http://vortex.com/~rshah1/service.cgi?your-subroutine

then prepare your service.cgi to handle the given QUERY_STRING and call the subroutine. I highly recommend to use a constant string for "your-subroutine" and map it to the call in your CGI (for security reason).
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will show, step by step, how to integrate R code into a R Sweave document
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses
Course of the Month15 days, 2 hours left to enroll

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question