½ÃÀÛÆäÀÌÁö·Î Áñ°Üã±âÃß°¡
·Î±×ÀÎ
ȸ¿ø°¡ÀÔ l Ã⼮üũ l ¸¶ÀÌÆäÀÌÁö l CGIMALL
ÀÚ·á½Ç »çÀÌÆ®µî·Ï ·©Å·100 ÇÁ·Î±×·¥¸®ºä °ü¸®ÀÚÃßõÀÚ·á Ãʺ¸°¡À̵å
Ä¿¹Â´ÏƼ
Àüü ÆîÃ帱â
Äü¸Þ´º¸µÅ© jquery , CSS , PHP , Javascript , ¹«·áÆùÆ® , ASP
»ó¼¼°Ë»ö
Ȩ > Ä¿¹Â´ÏƼ > Áú¹®°ú´äº¯ »ó¼¼º¸±â
Ä¿¹Â´ÏƼ ±¸Àα¸Á÷
»çÀÌÆ®µî·Ï
Ŭ¶ó¿ìµåű×
javascript
PHP
ASP
CSS
mysql
html
jquery
������
image
slide
API
°Ô½ÃÆÇ
¸Þ´º
ÇöÀçÁ¢¼ÓÀÚ ¸í »õ·Î°íħ
°Ô½ÃÆÇŸÀÌƲ Áú¹®°ú´äº¯ / »ó¼¼º¸±â
Æ®À§ÅÍ·Î º¸³»±â
Ãßõ¼ö 31 | Á¶È¸¼ö 662 | µî·ÏÀÏ 1999-10-19 09:57:52

´Ð³×ÀÓ

Anonymous

À̸ÞÀÏ

Á¦¸ñ

Á»´õ ÀÚ¼¼ÇÑ Áú¹®ÀÔ´Ï´Ù. °¨»ç^^
³»¿ë
Âü Ä£ÀýÇÏ°í ºü¸¥ °³½ÃÆÇÀ̱º¿ä. °¨»çÇÕ´Ï´Ù.
¸ÕÀú Á¦°¡ ÆÞ½ºÅ©¸³Æ®¿¡ ´ëÇؼ­ ¹®¿ÜÇÑÀ̶ó ¾û¶×ÇÑ Áú¹®À¸·Î
°ü¸®ÀÚ´ÔÀÇ ½Ã°£À» »©¾Ñ´Â°ÍÀÌ ¾Æ´ÑÁö °ÆÁ¤½º·´½À´Ï´Ù.
¸ÕÀú Á¦°¡ http://www.njkorean.com/kyellow/search.htmÀ» Àá½Ã ¹æ¹®ÇϽþî Á¦ Áú¹®ÀÌ Á¤È®ÇÑ °ÍÀ̾ú´ÂÁö È®ÀÎÇØ ÁÖ½Ã¸é °¨»çÇÏ°Ú½À´Ï´Ù.
Name ÀÇ µ¥ÀÌŸ Çʵå´Â ¿µ¹®°ú ÇѱÛÀÌ ¼¯¿©ÀÖ´Â »óȲÀÔ´Ï´Ù.
±×¸®°í search.htm¿¡¼­ ÀԷ°ªÀ» ¹Þ¾Æ ±×°ÍÀ¸·Î searchÇÏ´Â ÆÞ ½ºÅ©¸³Æ®Àε¥
Çѱ۴ܾ ÀÌ¿ëÇÑ °Ë»öÀ» ÇÒ¼ö°¡ ¾ø³×¿ä..
¾Æ·¡´Â ¾çÀÌ ¸¹±ä ÇÏÁö¸¸ Àüü ½ºÅ©¸³Æ®¸¦ ºÙ¿©¼­ ¿Ã¸³´Ï´Ù.
Á¦ ªÀº ¼Ò°ßÀ¸·Î´Â µ¥ÀÌŸ ÇüÀ» ´Ù·ç´Â ùºÎºÐ¿¡ ¹®Á¦°¡ ÀÖÀ»°Í °°½À´Ï´Ù.
±×¸®°í µµ¿òÀ» Áֽøé ÈÄ¿¡ ¹Ýµå½Ã ÀØÁö¾Ê°í °±µµ·Ï ³ë·ÂÇÏ°Ú½À´Ï´Ù.
=======================
#!/usr/local/bin/perl
#
#Make sure that the above line is at the very first line, not
#several lines down, and that it is completely flush with
#the left margin, or your script will not work.
#Depending on where Perl is on your server, the above location
#may not be correct. To find where Perl is, telnet to your
#server and at the prompt type: which perl This will tell you
#the correct path to Perl on your server
#Script Description
# Script Class: B
# Display Style: C: Display results across (with table border and labels)
# Search Style: C
# Unique ID: 933475716

#STEP A================================
#SCRIPT USAGE
#This is Version 4.1, released June 1, 1999
#If you use FLATTEXT on the Internet or on an Intranet,
#whether public access or not, payment is required.
#Send your check made payable to Thomas Zimmerman
#for $25.00 U.S. plus $10.00 for each additional
#FLATTEXT script you are using on your server to:
#Thomas Zimmerman, 232 S. Maple St., Bowling Green,
#Ohio 43402
#You can pay by credit card online at:
#http://www.flattext.com/register/
#You should pay for FLATTEXT as soon as you get your
#script successfully installed and in use.
#This service was designed to make some of the
#more difficult parts of publishing a database online easier
#and to make the process a little more technologically
#democratic. We
ve used some of the most basic Perl
#features and routines to keep your script easy to
#understand and modify.
#COPYRIGHT NOTICE
#This script is (c) 1999 by Thomas Zimmerman
#and must not be sold or redistributed in any form.
#We protect our these rights vigorously. If you have
#questions about the domain of this copyright, please
#contact us
#If you need to create a new script, feel free to return to
#the FLATTEXT page and do so. Your payments are
#based on the number of scripts you install and use,
#not create
#I am more than happy to help you if you experience
#any difficulties with this script. Many of the most
#common problems are addressed in the help
#files at:
#http://www.flattext.com/help/
read(STDIN, $input, $ENV{
CONTENT_LENGTH
});
# split the input
@pairs = split(/&/, $input);
# split the name/value pairs
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$value =~ tr/ / /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$FORM{$name} = $value;
}
#A1. The following lines get and process data passed
#through the URL, do not modify
$stringpassed=$ENV{
QUERY_STRING
};
#A2. Replace all plusses with spaces for data passed via URL
$stringpassed=~s/ / /g;
#A3. Get words passed to URL and get field name to search
( $Name, $Type, $City, $State, $Describe,$skiplast)=split(/&&/,$stringpassed);
#STEP B================================
#You MUST modify each of the variables in this this section
#B1. REQUIRED: The location of data file on your server. This must
#be the PATH to your data file, not the URL of your data file! There
#is extensive treatment of this in the Help Pages, under Data File
#Errors: http://flattext.com/help/
$data="/data1/hypermart.net/seongin/kyellow/datanyse/datanyse.txt";
#B2. REQUIRED: The URL of this file in your cgi-bin directory. You must
#provide the full URL, beginning with http
$thisurl="http://www.njkorean.com/kyellow/cgi-bin/dbsearch.pl";
#B3. OPTIONAL: You can format the opening and closing HTML
#of your results page in a separate file that can be written in
#regular HTML and saved on your server. If your script can
t
#find this file and open it, the default result screen is displayed
#instead. For ease of configuration, place it in the same directory
#as your data file. Note: this file must have three plusses
#where you want your search results inserted. See help file
#under Template Problems: http://flattext.com/help/
$openinghtml="/data1/hypermart.net/seongin/kyellow/datanyse/template.htm";
#B4. REQUIRED TO ADD, DELETE, OR MODIFY. See
#important information in the help files about adding additional
#Security features to your script.
#Change password to any combination of letters (A-Z, a-z) and
#numbers 0-1. USE ONLY LETTERS AND NUMBERS
$adminpassword="njkorean";
#URL to send users to after posting, editing, or getting errors.
#This is usually the main page for this section of your site
$forwardingURL="http://www.njkorean.com/kyellow/default.htm";
#STEP C================================
#C1. Maximum number of matching records to display per page
$maximumpage=15;
#C2. Maximum total number of records to display per search,
#for stylistic reasons, should be multiple of above nubmer
$maximum=250;
#STEP D================================
#You should not need to modify this section at all
$delimiter="""";
#D4. Get Password Entered by User
$checkpassword=$FORM{
checkpassword
};
#D7. Check to see if opening html file is on server
if (-e "$openinghtml"){
#D8. If so, open it and write opening and closing text to different arrays
$problem="Can
t open template file although it is on the server.";
open(OPENING, "$openinghtml") &pip;&pip; &security;
@wholefile=;
foreach $line (@wholefile){
if ($line =~ / /){
$line="";
$flipflop="Flip";}
if ($flipflop){
push (@closehtml,$line);}
else{
push (@openhtml,$line);}
}}
else {
$flipflop="Default";}
#D9. Figure out what action user wants to take.
$actiontotake=$FORM{
actiontotake
};
$linenumberpass=$FORM{
linenumberpass
};
#D10. If user wants to delete record, and has already
#verified password, then go to the makechange subroutine
if ($actiontotake eq "Delete Record"){
$recordaction="Deleted";
&makechange;
exit;}
#D11. If user wants to edit record, and has already
#verified password, then go to the makechange subroutine
if ($actiontotake eq "Edit Record"){
$recordaction="Edited";
&makechange;
exit;}
#D12. If user wants to edit record, to go subroutine to verify
if ($actiontotake eq "Edit"){
&edit;
exit;}
#D13. If user wants to delete record, to go subroutine to verify
if ($actiontotake eq "Delete"){
&delete;
exit;}
#D14. If user wants to add record, go to add subroutine
if ($actiontotake eq "Add"){
&addrecord;
exit;}
#STEP E================================
#E2. Get the data passed from user
if (!$Name){
$Name=$FORM{
Name
};}
#Copy data passed so that it can be passed again for next search
$Namepass=$Name;
#Copy data passed to the variable that we will work with throughout script
$Namework=$Name;
#Remove stray quote marks
$Namework=~s/"//g;
#Remove the word and, since they
re all AND
$Namework=~s/ and / /g;
$Namework=~s/ AND / /g;
#lowercase for easier matching
$Namework=lc($Namework);
#Search for the word select and if it appears, empty the string
if ($Namework=~/select/){
$Namework="";}
#E2. Get the data passed from user
if (!$Type){
$Type=$FORM{
Type
};}
#Copy data passed so that it can be passed again for next search
$Typepass=$Type;
#Copy data passed to the variable that we will work with throughout script
$Typework=$Type;
#Remove stray quote marks
$Typework=~s/"//g;
#Remove the word and, since they
re all AND
$Typework=~s/ and / /g;
$Typework=~s/ AND / /g;
#lowercase for easier matching
$Typework=lc($Typework);
#Search for the word select and if it appears, empty the string
if ($Typework=~/select/){
$Typework="";}
#E2. Get the data passed from user
if (!$City){
$City=$FORM{
City
};}
#Copy data passed so that it can be passed again for next search
$Citypass=$City;
#Copy data passed to the variable that we will work with throughout script
$Citywork=$City;
#Remove stray quote marks
$Citywork=~s/"//g;
#Remove the word and, since they
re all AND
$Citywork=~s/ and / /g;
$Citywork=~s/ AND / /g;
#lowercase for easier matching
$Citywork=lc($Citywork);
#Search for the word select and if it appears, empty the string
if ($Citywork=~/select/){
$Citywork="";}
#E2. Get the data passed from user
if (!$State){
$State=$FORM{
State
};}
#Copy data passed so that it can be passed again for next search
$Statepass=$State;
#Copy data passed to the variable that we will work with throughout script
$Statework=$State;
#Remove stray quote marks
$Statework=~s/"//g;
#Remove the word and, since they
re all AND
$Statework=~s/ and / /g;
$Statework=~s/ AND / /g;
#lowercase for easier matching
$Statework=lc($Statework);
#Search for the word select and if it appears, empty the string
if ($Statework=~/select/){
$Statework="";}
#E2. Get the data passed from user
if (!$Describe){
$Describe=$FORM{
Describe
};}
#Copy data passed so that it can be passed again for next search
$Describepass=$Describe;
#Copy data passed to the variable that we will work with throughout script
$Describework=$Describe;
#Remove stray quote marks
$Describework=~s/"//g;
#Remove the word and, since they
re all AND
$Describework=~s/ and / /g;
$Describework=~s/ AND / /g;
#lowercase for easier matching
$Describework=lc($Describework);
#Search for the word select and if it appears, empty the string
if ($Describework=~/select/){
$Describework="";}
#E5. Get number of records already displayed
$startitem=$FORM{
startitem
};
#E6. Figure the last record to display on this page
$enditem=$startitem $maximumpage;
($Name1, $Name2, $Name3, $Name4, $Name5, $Name6, $Name7)=split(/ /, $Namework);
($Type1, $Type2, $Type3, $Type4, $Type5, $Type6, $Type7)=split(/ /, $Typework);
($City1, $City2, $City3, $City4, $City5, $City6, $City7)=split(/ /, $Citywork);
($State1, $State2, $State3, $State4, $State5, $State6, $State7)=split(/ /, $Statework);
($Describe1, $Describe2, $Describe3, $Describe4, $Describe5, $Describe6, $Describe7)=split(/ /, $Describework);

#STEP H================================
#Do not modify this section
#H1. Open datafile and write contents to an array, if can
t open report the problem at the security subroutine
$problem="Can
t open the data file to search from it. Please verify that you have provided the correct value at Step B1.";
open (FILE, "$data") &pip;&pip; &security;
@all=;
close (FILE);
#There is no STEP I
#STEP J================================
#J1. The line below is required, do not modify
print "Content-type: text/html

";
#J2. If can
t find opening html, display default header
if ($flipflop eq "Default"){
print "
";
print "Your Search Results
";
#print "
";}
print "http://www.njkorean.com/yellow2.gif">
";}
else{
#J3. If can find opening html file display opening html stored in array
print "http://www.njkorean.com/yellow2.gif">
";
print "@openhtml
";}
#STEP K================================
#K3. Show words user searched for
print "You Searched For:

    ";
    if ($Namework){
    print "
  • Name=$Namepass
    ";}
    if ($Typework){
    print "
  • Type=$Typepass
    ";}
    if ($Citywork){
    print "
  • City=$Citypass
    ";}
    if ($Statework){
    print "
  • State=$Statepass
    ";}
    if ($Describework){
    print "
  • Describe=$Describepass
    ";}
    print "

";
#STEP L================================
#L1. Read each line of the data file, compare with search words
foreach $line (@all){
$line=~s/
//g;
#Keep track of loops
$loopsaround ;
$linetemp1=lc($line);
($Name,$Type,$Address,$City,$State,$Zip,$Phone,$Fax,$Email,$Homepage,$Describe,$skipthisfield)=split (/$delimiter/,$linetemp1);
#L2. This line specifies the fields to sort results by
#See help databases for patches to allow various kinds of sorts
$line="$Name$Type$City$delimiter$loopsaround$delimiter$line";
#L3. This line removes stray leading spaces before sorting your results
$line=~s/^ //;
$increcount=0;
if (($Name =~/$Name1/ && $Name =~/$Name2/ && $Name =~/$Name3/ && $Name =~/$Name4/ && $Name =~/$Name5/ && $Name=~/$Name6/ && $Name =~/$Name7/) &pip;&pip; !$Namepass) {
$increcount ;}
if (($Type =~/$Type1/ && $Type =~/$Type2/ && $Type =~/$Type3/ && $Type =~/$Type4/ && $Type =~/$Type5/ && $Type=~/$Type6/ && $Type =~/$Type7/) &pip;&pip; !$Typepass) {
$increcount ;}
if (($City =~/$City1/ && $City =~/$City2/ && $City =~/$City3/ && $City =~/$City4/ && $City =~/$City5/ && $City=~/$City6/ && $City =~/$City7/) &pip;&pip; !$Citypass) {
$increcount ;}
if (($State =~/$State1/ && $State =~/$State2/ && $State =~/$State3/ && $State =~/$State4/ && $State =~/$State5/ && $State=~/$State6/ && $State =~/$State7/) &pip;&pip; !$Statepass) {
$increcount ;}
if (($Describe =~/$Describe1/ && $Describe =~/$Describe2/ && $Describe =~/$Describe3/ && $Describe =~/$Describe4/ && $Describe =~/$Describe5/ && $Describe=~/$Describe6/ && $Describe =~/$Describe7/) &pip;&pip; !$Describepass) {
$increcount ;}
if ($increcount==5){
push (@keepers,$line);}}
#STEP M================================
#M1. Sort matches stored in array
@keepers=sort(@keepers);
#M2. Get and display number of matches found
$length1=@keepers;
#M3. If the number of matches is less than enditem, adjust
if ($length1<$enditem){
$enditem=$length1;
$displaystat="Y";}
#M4. The first field about to display
$disstart=$startitem 1;
#M5. Show user total number of matches found
if ($length1){
print "$length1 Matches Found (displaying $disstart to $enditem)

";
} else {
print "Your search found zero records, please try again.

";}
#STEP N================================
#Note: Sub-step numbers in this step may not be in order, that
s OK
#N1-. Opening HTML to show results in specified format begins
#N1- Open table
$totalmatches=@keepers;
if ($totalmatches>0){
print "
";
#Display headers of table
print "
";
print "
";
print "
";
print "
";
print "
";
print "
";
print "
";
#print "
";
#print "
";
#print "
";
print "
";
print "
";}
#N2. Keep track of results processed on this page
foreach $line (@keepers){
#N3. Delete stray hard returns
$line=~s/
//g;
#N4. Keep track of records displayed
$countline1 ;
#N5. Decide whether or not this record goes on this page
if ($countline1>$startitem && $countline1<=$enditem){
#N6. Open each line of sorted array for displaying
($sortfield,$loopsaround,$Name,$Type,$Address,$City,$State,$Zip,$Phone,$Fax,$Email,$Homepage,$Describe,$skipthisfield)=split (/$delimiter/,$line);
print "
";
#N10. Remove stray quotation marks from csv
$Name=~s/"//g;
$Homepage=~s/"//g;
#N11. Display fields in format you selected
#print "
";
if ($Homepage eq ""){
print "
";}
else{
print "
";}

#N10. Remove stray quotation marks from csv
$Type=~s/"//g;
#N11. Display fields in format you selected
print "
";
#N10. Remove stray quotation marks from csv
$Address=~s/"//g;
$City=~s/"//g;
$Address2 = $Address;
$Address2 =~ tr/ / /;
$City2 = $City;
$City2 =~ tr/ / /;
#N11. Display fields in format you selected
#print "
";
#if ($adminpassword eq $checkpassword){
print "
";
#N10. Remove stray quotation marks from csv
#$City=~s/"//g;
#N11. Display fields in format you selected
print "
";
#N10. Remove stray quotation marks from csv
$State=~s/"//g;
#N11. Display fields in format you selected
print "
";
#N10. Remove stray quotation marks from csv
$Zip=~s/"//g;
#N11. Display fields in format you selected
print "
";
#N10. Remove stray quotation marks from csv
$Phone=~s/"//g;
$Fax=~s/"//g;
#N11. Display fields in format you selected
if ($Email eq ""){
if ($Fax eq ""){
print "
";}
else{
print "
";}
}
else{
if ($Fax eq ""){
print "
";}
else{
print "
";}
}

#N10. Remove stray quotation marks from csv
#$Fax=~s/"//g;
#N11. Display fields in format you selected
#print "
";
#N10. Remove stray quotation marks from csv
$Email=~s/"//g;
#N11. Display fields in format you selected
#print "
";
#N10. Remove stray quotation marks from csv
#$Homepage=~s/"//g;
#N11. Display fields in format you selected
#print "
";
#N10. Remove stray quotation marks from csv
$Describe=~s/"//g;
#N11. Display fields in format you selected
print "
";
if ($adminpassword eq $checkpassword){
print "
";}
print "
";
#STEP O================================
#O1. If total displayed equals maximum you set, then exit
if ($countline1 == $maximum && $maximum){
$problem2="Your search was terminated at $maximum records, please be more specific in your search";
last;}
#O2. If script just got to last match then exit program
if ($length1 == $countline1){
last;}
#O3. If script is at the end of a page then show NEXT button
if ($countline1 == $enditem && $displaystat ne "Y" && $maximum>$countline1){
$stopit="Y";
last;
}
}}
print "
NameTypeAddressCityStateZipPhoneFaxEmailHomepageDescribe
$Name$Name$Name$Type$Addresshttp://maps.yahoo.com/py/maps.py?Pyt=Tmap&addr=$Address2&csz=$City2, $State $Zip&Get Map=Get Map target=_blank>$Address$City$State$Zip$Phone$Phone, (Fax)$Fax$Phone$Phone, (Fax)$Fax$Fax$Email$Homepage$Describe

";
#STEP P================================
#P1. Display NEXT MATCHES button
if ($stopit eq "Y"){
print "

";
#P2. Pass hidden variables so script will know how to display next page
print "
";
print "
";
print "
";
print "
";
print "
";
print "
";
print "

";
}
#P3. Show problems and credits, please retain this line
#print "$problem2
Search Results by http://www.flattext.com/">FLATTEXT

";
#P4. If opening.htm was not found, show default closing html codes
if ($flipflop eq "Default"){
print "
";}
else{
#P5. If opening.htm was found, show its closing html codes
print "@closehtml
";}
exit;
#STEP Q================================
sub security{
print "Content-type: text/html

";
#Q1. If can
t find opening html, display default header
if ($flipflop eq "Default"){
print "
";
print "Security or Data Error
";
print "
";}
else{
#Q2. If can find opening html file display opening html stored in array
print "@openhtml
";}
print "
Data Error


";
print "Please correct the following error:
$problem

";
#Q3. If opening.htm was not found, show default closing html codes
if ($flipflop eq "Default"){
print "
";}
else{
#Q4. If opening.htm was found, show its closing html codes
print "@closehtml
";}
exit;
}
#STEP R================================
sub edit{
#R1. Open data file and read it
$problem="Can
t open data file to read from it at edit subroutine";
open (FILE, "$data") &pip;&pip; &security;
@all=;
close (FILE);
#R2. Read each line of the data file
foreach $line (@all){
$line=~s/
//g;
($copyName,$copyType,$copyAddress,$copyCity,$copyState,$copyZip,$copyPhone,$copyFax,$copyEmail,$copyHomepage,$copyDescribe,$skipthisfield)=split (/$delimiter/,$line);
$keepcount ;
#R3. Find the line user wants to modify
if ($keepcount==$linenumberpass){
$linetokeep=$line;
last;
}
}
#R4. Check password sent via hidden field
if ($adminpassword ne $checkpassword){
$problem="Your password does not match the master password. Step R4 Error";
&security;}
#Required Header, do not delete
print "Content-type: text/html

";
#R5. If can
t find opening html, display default header
if ($flipflop eq "Default"){
print "
";
print "Modification Screen
";
#print "
";}
print "http://www.njkorean.com/yellow2.gif">
";}
else{
#R6. If can find opening html file display opening html stored in array
print "http://www.njkorean.com/yellow2.gif">
";
print "@openhtml
";}
print "
Edit this Record


";
#R7. Split matching line into its respective variables
($Name,$Type,$Address,$City,$State,$Zip,$Phone,$Fax,$Email,$Homepage,$Describe,$skipthisfield)=split (/$delimiter/,$linetokeep);
#R8. Show Edit HTML
print "

";
print "
";
$Name=~s/"//g;
$Type=~s/"//g;
$Address=~s/"//g;
$City=~s/"//g;
$State=~s/"//g;
$Zip=~s/"//g;
$Phone=~s/"//g;
$Fax=~s/"//g;
$Email=~s/"//g;
$Homepage=~s/"//g;
$Describe=~s/"//g;
print "
";
print "
";
print "
";
print "
";
print "
";
print "
";
print "
";
print "
";
print "
";
print "
";
print "
";
print "
Name:
Type:
Address:
City:
State:
Zip:
Phone:
Fax:
Email:
Homepage:
Describe:

";
print "
";
print "
";
print "


";
#R10. If opening.htm was not found, show default closing html codes
if ($flipflop eq "Default"){
print "
";}
else{
#R11. If opening.htm was found, show its closing html codes
print "@closehtml
";}
exit;
}
sub delete{
#S1. Open data file and read it
$problem="Can
t open data file to read from it at delete subroutine";
open (FILE,"$data") &pip;&pip; &security;
@all=;
close (FILE);
#S2. Read each line of the file
foreach $line (@all){
$line=~s/
//g;
($copyName,$copyType,$copyAddress,$copyCity,$copyState,$copyZip,$copyPhone,$copyFax,$copyEmail,$copyHomepage,$copyDescribe,$skipthisfield)=split (/$delimiter/,$line);
$keepcount ;
#S3. Find line to delete
if ($keepcount==$linenumberpass){
$linetokeep=$line;
last;
}
}
#S4. Check password sent via hidden field
if ($adminpassword ne $checkpassword){
$problem="Your password does not match the master password. Step S4 Error";
&security;}
#Requred Header, do not delete
print "Content-type: text/html

";
#S5. If can
t find opening html, display default header
if ($flipflop eq "Default"){
print "
";
print "Delete This Record
";
#print "
";}
print "http://www.njkorean.com/yellow2.gif">
";}
else{
#If can find opening html file display opening html stored in array
print "http://www.njkorean.com/yellow2.gif">
";
print "@openhtml
";}
print "
Delete this Record?


";
($Name,$Type,$Address,$City,$State,$Zip,$Phone,$Fax,$Email,$Homepage,$Describe,$skipthisfield)=split (/$delimiter/,$linetokeep);
#S6. Show validation HTML
print "

";
print "
";
$Name=~s/"//g;
$Type=~s/"//g;
$Address=~s/"//g;
$City=~s/"//g;
$State=~s/"//g;
$Zip=~s/"//g;
$Phone=~s/"//g;
$Fax=~s/"//g;
$Email=~s/"//g;
$Homepage=~s/"//g;
$Describe=~s/"//g;
print "
";
print "
";
print "
";
print "
";
print "
";
print "
";
print "
";
print "
";
print "
";
print "
";
print "
";
print "
Name: $Name
Type: $Type
Address: $Address
City: $City
State: $State
Zip: $Zip
Phone: $Phone
Fax: $Fax
Email: $Email
Homepage: $Homepage
Describe: $Describe


";
print "
";
print "
";
print "


";
#If opening.htm was not found, show default closing html codes
if ($flipflop eq "Default"){
print "
";}
else{
print "@closehtml
";}
exit;
}
#STEP T================================
sub makechange{
#T1. For each variable, translate it, remove any delimiters that
#user may have accidentally included, replace hard returns with
#HTML line breaks, and delete all carriage returns
$Name=$FORM{
Name
};
$Name=~s/$delimiter//g;
$Name=~s/
/
/g;
$Name=~s/ //g;
$Type=$FORM{
Type
};
$Type=~s/$delimiter//g;
$Type=~s/
/
/g;
$Type=~s/ //g;
$Address=$FORM{
Address
};
$Address=~s/$delimiter//g;
$Address=~s/
/
/g;
$Address=~s/ //g;
$City=$FORM{
City
};
$City=~s/$delimiter//g;
$City=~s/
/
/g;
$City=~s/ //g;
$State=$FORM{
State
};
$State=~s/$delimiter//g;
$State=~s/
/
/g;
$State=~s/ //g;
$Zip=$FORM{
Zip
};
$Zip=~s/$delimiter//g;
$Zip=~s/
/
/g;
$Zip=~s/ //g;
$Phone=$FORM{
Phone
};
$Phone=~s/$delimiter//g;
$Phone=~s/
/
/g;
$Phone=~s/ //g;
$Fax=$FORM{
Fax
};
$Fax=~s/$delimiter//g;
$Fax=~s/
/
/g;
$Fax=~s/ //g;
$Email=$FORM{
Email
};
$Email=~s/$delimiter//g;
$Email=~s/
/
/g;
$Email=~s/ //g;
$Homepage=$FORM{
Homepage
};
$Homepage=~s/$delimiter//g;
$Homepage=~s/
/
/g;
$Homepage=~s/ //g;
$Describe=$FORM{
Describe
};
$Describe=~s/$delimiter//g;
$Describe=~s/
/
/g;
$Describe=~s/ //g;
#T3. This step either replaces or empties the existing line
if ($recordaction eq "Deleted"){
$replacementline="";}
else{
$replacementline="$Name$delimiter$Type$delimiter$Address$delimiter$City$delimiter$State$delimiter$Zip$delimiter$Phone$delimiter$Fax$delimiter$Email$delimiter$Homepage$delimiter$Describe";}
if ($recordaction ne "Deleted"){
}
$problem="Can
t open data file to read from it at Step T";
open (FILE,"$data") &pip;&pip; &security;
@all=;
close (FILE);
$linenumberpass--;
$all[$linenumberpass]=$replacementline;
$problem="Can
t open temporary file. You need to chmod 707 or 777 the directory your data file is in. See the help files under Permissions for Class B Scripts.";
#T7. Write the entire changed file to a temporary file
open (FILE2,">$data.tmp") &pip;&pip; &security;
foreach $line (@all){
$line=~s/
//g;
print FILE2 "$line
";}
#T7. Rename the temp file to your master data file
$problem="Can
t rename file after making change";
rename("$data.tmp", "$data") &pip;&pip; &security;
print "Content-type: text/html

";
#T9. If can
t find opening html, display default header
if ($flipflop eq "Default"){
print "
";
print "Edit This Record
";
print "http://www.njkorean.com/yellow2.gif">
";}
#print "
";}
else{
#T10. If can find opening html file display opening html stored in array
print "http://www.njkorean.com/yellow2.gif">
";
print "@openhtml
";}
print "Your record has been $recordaction.";
#Please click here to continue.
";
close (FILE);
#If opening.htm was not found, show default closing html codes
if ($flipflop eq "Default"){
print "
";}
else{
print "@closehtml
";}
exit;
}
#STEP U================================
#This subroutine adds records to your database
sub addrecord{
$Name=$FORM{
Name
};
$Type=$FORM{
Type
};
$Address=$FORM{
Address
};
$City=$FORM{
City
};
$State=$FORM{
State
};
$Zip=$FORM{
Zip
};
$Phone=$FORM{
Phone
};
$Fax=$FORM{
Fax
};
$Email=$FORM{
Email
};
$Homepage=$FORM{
Homepage
};
$Describe=$FORM{
Describe
};
#U1. Check password
if ($adminpassword ne $checkpassword && $adminpassword){
$problem="The password you entered does not match your administration password. Please press BACK on your browser to fix this problem.";
&security;}
#U2. Replace hard returns with html line break for each, delete carriage returns
$Name=~s/
/
/g;
$Name=~s/ //g;
$Type=~s/
/
/g;
$Type=~s/ //g;
$Address=~s/
/
/g;
$Address=~s/ //g;
$City=~s/
/
/g;
$City=~s/ //g;
$State=~s/
/
/g;
$State=~s/ //g;
$Zip=~s/
/
/g;
$Zip=~s/ //g;
$Phone=~s/
/
/g;
$Phone=~s/ //g;
$Fax=~s/
/
/g;
$Fax=~s/ //g;
$Email=~s/
/
/g;
$Email=~s/ //g;
$Homepage=~s/
/
/g;
$Homepage=~s/ //g;
$Describe=~s/
/
/g;
$Describe=~s/ //g;
$replacementline="$Name$delimiter$Type$delimiter$Address$delimiter$City$delimiter$State$delimiter$Zip$delimiter$Phone$delimiter$Fax$delimiter$Email$delimiter$Homepage$delimiter$Describe$delimiter";
#U3. Write the new record to the bottom of the data file
$problem="Can
t write to the data file. Please verify its location and change its permissions to 777.";
open (FILE2,">>$data") &pip;&pip; &security;
print FILE2 "$replacementline
";
print "Content-type: text/html

";
#U4. If can
t find opening html, display default header
if ($flipflop eq "Default"){
print "
";
print "Record Added
";
#print "
";}
print "http://www.njkorean.com/yellow2.gif">
";}
else{
#U5. If can find opening html file display opening html stored in array
print "http://www.njkorean.com/yellow2.gif">
";
print "@openhtml
";}
print "Your record has been added.";
#Please click here to continue.
";
close (FILE);
#If opening.htm was not found, show default closing html codes
if ($flipflop eq "Default"){
print "
";}
else{
print "@closehtml
";}
exit;
}

Ãßõ½ºÅ©·¦¼Ò½ºº¸±â ¸ñ·Ï
ÀÌÀü°Ô½Ã±Û ·¹µåÇÞ ¸®´ª½º¿¡¼­ lanÄ«µå ÀνĹæ¹ý 1999-10-19 08:43:23
´ÙÀ½°Ô½Ã±Û CGI»ç¿ë¹ý 1999-10-19 10:10:25