www.pudn.com > cadisrch.zip > cadi_in.pl
#! /usr/local/bin/perl
#############################################################
# CADI-Search - Version 0.07 Beta - May 1997 #
# Copyright Philippe Cadic ccadic@planetepc.fr #
# President of the Communication Quality Association #
# Post Box 2887 - 41028 Blois cedex - France #
# Phone/Fax: (+33)(0)-2-54560876 #
# #
# You can use this program freely. In all cases, this #
# header should remain intact. Thsi program is freeware #
# if you use it in a non-commercial environment. If you #
# plan to do some business with it, please contact me #
# for a commercial license and arrangments. All gov #
# organization or departments should alos get a license #
# #
# You may customize the GFX of CADI-Search by modifying #
# the GIF files of the package. In all the cases, the #
# file "mini.jpg" must remain un-changed and published #
# in your main page's botton with a link on #
# http://www.spiraweb.com/cadi-search/faq.html #
# #
# The program is provided as this with no garantees #
# Use it at your own risks. No hot line nore bug-fix #
# service is provided (I will do my best to carry on #
# developing but with no garantee #
# #
# If you do mods to the source code, please e-mail me #
# had be glad to know them and mention your participa- #
# tion in the README file of the package #
# #
#############################################################
#Please edit the following lines
# Installation
# UnZip the package, edit html files as you like, place them
# with the gif & jpg files into a new web directory
# Place the 2 .pl files into the CGI-Local or CGI-BIN directory and chmod them
# Configuration var
#
# Think of chmod to 777 the 'base.txt'
# Think of chmod 755 script cadi_in.pl and it brother
#
$base ='/home/cgi-local/base.txt'; # Where is the database ?
$urlcadi = 'http://www.provider.com/cadisearch'; #The URL of your search engine (no slash, no html)
#The main page of the search directory is supposed called: index.html
# Nothing else should be modified if you keep all files of the package
# Routine d'erreur
sub error
{ print "Content-type: text/html\n\n";
print "Error ... \n";
print "Input Error
\n";
print "Press on the 'Back' button and re-submit\n";
print "";
exit;
}
# Securite contre les curieux
if ($ENV{'REQUEST_METHOD'} ne "POST") {$error;
exit;
}
# Suce les donnees de la page web
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
# Split the name-value pairs
@pairs = split(/&/, $buffer);
foreach $pair (@pairs)
{
($name, $value) = split(/=/, $pair);
# Un-Webifie les signes plus et %-encoding
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$FORM{$name} = $value;
}
#Controle de la presence d'un HTTP://
if ($FORM{'url'}=~ /http:\/\//) {} else {&error};
# Ecriture fichier base
$ligne = join ("::","$FORM{'url'}","$FORM{'titre'}","$FORM{'mots'}","$FORM{'email'}");
open (FICHIER,">>$base" );
print FICHIER ("$ligne \n");
# Affichage de bon fonctionnement
print "Content-type: text/html\n\n";
print ("
The following informations have been recorded into the CADI-



The following
informations have been recorded into the CADI-Search
database:Web's URL:
$FORM{'url'}
Description: $FORM{'titre'}
Key words : $FORM{'mots'}
e-mail addr: $FORM{'email'}
Return to CADI-Search Main menu
© 1997 Philippe
Cadic.
All images, html and
source codes are copyright 1997
For source code, please e-mail