#!/usr/bin/perl -w #!C:/xampp/perl/bin/perl -w # # This file is part of a HTML-CGI tutorial # # (C) Copyright 1999 Hans Kern # # File name : pldemo20.cgi # Created by : Hans Kern # Creation date: 31.3.99 # # This perl script tuto1.cgi sends an answer to # the client call of tuto1_post.htm or tuto1_get.htm # The answer is a HTML-document consisting of # a textfield that contains the information # send by the client but additionally enclosed in ***. # Required at Hochschule Karlsruhe: # 1) End-Of-Line must conform to UNIX-Standards. # UNIX: LF = 0A # PC: CR LF = 0D 0A # Mac: LF CR = 0A 0D # 2) The extension of the script must be .cgi # 3) The first line of the script must contain # the location of the perl interpreter. # #!C:/xampp/perl/bin/perl -w # 4) The script must be executable, not readable. # chmod 711 script # 5) The directory containing the script must # be readable and executable. # chmod 755 directory # 6) The script must produce a valid html-page. # Debugging at Hochschule Karlsruhe: # 1) Start the script in a desktop. use CGI; $wp = new CGI; print $wp->header; print $wp->start_html(-title=>'Answer'); #print $wp->startform(-method=>$method, # -action=>$action); print $wp->startform(-method, -action); print '

Servers answer

'; print "

You requested this page with
". $ENV{HTTP_USER_AGENT} . "
"; print "by entering
". $ENV{HTTP_REFERER} . "\n

"; $help = $wp->param ('my_field'); $wp->param ('servers_return1',"\*\*\*$help\*\*\*"); print $wp->textfield(-name=>'servers_return1', -size=>'40'); print $wp->endform; print $wp->end_html;