=pod Code submission from: Paul Schaap (schaappa@ozemail.com.au) goHelpers 1.0.0 Release Notes WHY === The web browsers have an excellent (but possibly dangerous) feature called helpers. Basically all you have to do is set up your Web Server to send a mime type header in this example I made up "text/ pacerscript" and the set up your Browser to use the terminal emulator "Pacerterm" as a helper for this mime type. Just think of the possibilities this opens up for an automated login etc. to help silly users etc., I also did a "text/kqmacro" for running a Keyquencer script to automate a procedure on an unapplescriptable application, the joys of an Intranet over the Internet :-). Do be warned however due to the power of such a concept this capability could open you up to some real nasty possibilities, e.g. an AppleScript that deletes the Hard Drive etc..., it almost rivals all those putrid Microsoft Word Macro Viruses ;-P. INSTALLATION ============ ï Install MacPerl 5.1.4r4 or greater. (Thanx Matthias) ï Get OS8, well strictly not required but get it anyway :-) USAGE ===== 1) Put CGI go.Pacerterm.acgi & pform.pl in your WebServer. 2) Set the Application "Pacerterm" as the helper. 3) Run up the Browser and give it a go. CHANGES ======= V1.0.0 ï Well none really, first cut. CHEERS schaapp@ozemail.com.au - I Only read email once a fortnight, sorry. =cut #!perl ################################################################################ # PROGRAM : pform.pl # BY : Paul Schaap (Actually someone else, but they would appreciate..) # DATED : 16/10/96 ################################################################################ 1; sub parse_form_data { local (*FORM_DATA) = @_; $query_string = ""; local ($request_method, @key_value_pairs, $key_value, $key, $value); $request_method = $ENV{'REQUEST_METHOD'}; if($request_method eq "GET"){ $query_string = $ENV{'QUERY_STRING'}; } elsif ($request_method eq "POST"){ read(STDIN, $query_string, $ENV{"CONTENT_LENGTH"}); } else { #print "Content-Type: text/html\n\n500, Server Error, Unsupported method"); } @key_value_pairs = split(/&/, $query_string); foreach $key_value (@key_value_pairs) { ($key, $value) = split(/=/, $key_value); $value =~ tr/+/ /; $value =~ s/%([\dA-Fa-f][\dA-Fa-f])/pack ("C", hex($1))/eg; if (defined($FORM_DATA{$key})){ $FORM_DATA{$key} = join("\0", $FORM_DATA{$key}, $value); } else { $FORM_DATA{$key} = $value; } } # New appn decoder #================== $form{'appn'} =~ s/%([\dA-Fa-f][\dA-Fa-f])/pack ("C", hex($1))/eg; @appn_value_pairs = split(/&/, $form{'appn'}); foreach $appn_value (@appn_value_pairs) { ($appn, $value) = split(/=/, $appn_value); $value =~ tr/+/ /; $value =~ s/%([\dA-Fa-f][\dA-Fa-f])/pack ("C", hex($1))/eg; if (defined($FORM_DATA{$appn})){ $FORM_DATA{$appn} = join("\0", $FORM_DATA{$appn}, $value); } else { $FORM_DATA{$appn} = $value; } } # END 1; }