Solved

Dynamin Pages under Perl for Win32

Posted on 1997-03-02
2
210 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 50 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

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…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

687 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