Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Dynamin Pages under Perl for Win32

Posted on 1997-03-02
2
Medium Priority
?
215 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
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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

In this tutorial I will focus on how to use WhizBase as a tool for sending ICQ messages to ICQ. Here I will use a new technology in WhizBase, published in WhizBase 5.1 version. In this tutorial I will use 3 files, pager.wbsp for the processing, e…
It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses

885 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