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
Solved

Dynamin Pages under Perl for Win32

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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

It is becoming increasingly popular to have a front-page slider on a web site. Nearly every TV website,  magazine or online news has one on their site, and even some e-commerce sites have one. Today you can use sliders with Joomla, WordPress or …
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…

839 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