[ Next-in-Thread ]  [ Next Message ] 

scripts for cgi and web interaction 

Forum: CSIT 168 UNIX
Date: Aug 27, 19:30
From: D. Titchenell <[email protected]>

#simple script that sends the log summary by mail
 (echo "Subject: referlog"; cat referlog.txt | cut -d / -f 3 | freq) | sendmail [email protected]      

 ==========================
 # simple CGI script in bash
 #!/usr/local/bin/bash

 echo "Content-type: text/html"
 echo
 echo "here we are again"        

 ===========================
 #!/usr/bin/perl
 ######################

 #unwebify
 $buffer = <ARGV>;

 # Split the name=value pairs
 @pairs = split(/&/, $buffer);

 foreach $pair (@pairs)
 {
     ($name, $value) = split(/=/, $pair);

     # Un-Webify plus signs and %-encoding
     $pair =~ tr/+/ /;
     $pair =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;

 # Print the outputvalue pair.
   print "$pair\n";
 }

[ Next-in-Thread ]  [ Next Message ] 

[ Add Message ]  to: "scripts for cgi and web interaction"

[ Members ]  [ Subscribe ]  [ Admin Mode ]  [ Show Frames ]  [ Help for HyperNews at www.flamingyoyo.org 1.10 ] 

Hosted by www.Geocities.ws

1