?
Solved

Dynamin Pages under Perl for Win32

Posted on 1997-03-02
2
Medium Priority
?
212 Views
Last Modified: 2013-12-25
Hi,

    that's the first time I am trying to write a CGI. I want the user to enter some information and
    then I would like to return him/her a response. I am developing the CGI in Perl for Win32. As
    I understand it, in the HTML document I write the following:

    <FORM METHOD="POST" ACTION="cgi-local\outtest.pl" TARGET="_parent">
    <INPUT TYPE="TEXT" NAME="_search_string">
    <INPUT TYPE="RESET" VALUE="Clear">
    <INPUT TYPE="SUBMIT" VALUE="Search">
    </FORM>

    then, in the outtest.pl file I write:

    print "Content-type: text/html","\n\n" ;
    print"<html><head>";
    print"<title>CGI Results</title></head><body>";
    print"<h1>Hello, world.</h1>";
    print"</body></html>";

    There is no connection between the output of the CGI and the input of the user. I just want to
    see if I am able to invoke the CGI from the HTML page.

    When I run the ouuttest.pl file on its own it runs fine, but when I want to run it from the
    browser (the HTML page) I do not know how
    print the dynamic page to the user as an HTML page.

    Any information/help would be greatly appreciated

    Ronny Shalev
0
Comment
Question by:rys
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Accepted Solution

by:
henryj earned 150 total points
ID: 1827733
When the HTML page is shown and the person viewing it presses the submit button the page will attempt to execute the script specified in the action part of the FORM tag. So providing you are running this on a web server (you do need a web server to do this as the page cannot call the script properly without one) it should execute your script.

However, be careful. I noticed you put your script in a directory called /cgi-local - If you are using a MS web server for Win32 this would be the wrong name. MS web servers by default use the directory /scripts for this purpose. Also be certain to check that you have correctly set up PERL as a scripting language for your web server in the registry.

If you need more help then send more details about what the situation is on that machine (ie. wether you are running a server or not)...

rgds,

henry

0
 

Expert Comment

by:nunamakt
ID: 1827734
What web server are you using?  I'm using O'Reilly's WebSite Pro. It's very easy to use (www.ora.com).  I assume you've already made PL the default extension so PERL will be executed with a .PL file.

Make sure your script is in an executable directory.  Website can change where that is.  I assume yours can too.

Oh...I see one more problem.  In PERL, the "\" is a special character.  You have to tell PERL that its not special.. Here's what you have to write instead:

print "Content-type: text/html","\n\n";
print"<html><head>";
print"<title>CGI Results<\/title><\/head><body>";
print"<h1>Hello, world.<\/h1>";
print"<\/body><\/html>";

Give that a try...it should work MUCH better!!!

Tom Nunamaker
nunamakt@toshop.com

0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

This tutorial will discuss the log-in process using WhizBase. In this article I assume you already know HTML. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you might look at some of my other articles abo…
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

752 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