#!/usr/bin/perl use CGI; $query = new CGI; $stringpassed=$ENV{'QUERY_STRING'}; $stringpassed=~s/\+/ /g; #STEP B================================ $data="C:\\inetpub\\vhosts\\buffalobills.ca\\httpdocs\\db\\photo-gallery-data.txt"; $tempdata="C:\\inetpub\\vhosts\\buffalobills.ca\\httpdocs\\db\\photo-gallery-data-temporary.txt"; $thisurl="http://www.buffalobills.ca/cgi-bin/photo-gallery.cgi"; $openinghtml="C:\\inetpub\\vhosts\\buffalobills.ca\\httpdocs\\control\\photo-template1.htm"; $adminpassword="bb99"; $forwardingURL="http://www.buffalobills.ca/control/"; $Imageuploadpath="C:\\inetpub\\vhosts\\buffalobills.ca\\httpdocs\\images\\galleryimages\\"; $ImageuploadURL="http://www.buffalobills.ca/images/galleryimages/"; $Imagemaxz="99"; $allowimageuploadonedit="Y"; $deleteonimagerecorddelete="Y"; $counterfile="C:\\inetpub\\vhosts\\buffalobills.ca\\httpdocs\\db\\photo-gallery-counter.txt"; #STEP C================================ $maximumpage=100; $maximum=100000; @variablenames = $query->param; foreach $variable (@variablenames){ $value=$query->param($variable); $tempapprove{$variable}="$value";} #STEP D================================ #You should not need to modify this section at all #D1. Check to see if opening html file is on server if (-e "$openinghtml"){ #D2. If so, open it and write opening and closing text to different strings #to be used throughout the script $problem="Can't open template file. Make sure you are referencing the file and not just a directory."; open(OPENING, "$openinghtml") || &security; @wholefile=; close(OPENING); $fulltemplate=join("\n",@wholefile); ($templatestart,$templateend)=split(/\+\+\+/,$fulltemplate);} else{ #D3. If template file not found, use this for now $templatestart="$templatetitle"; $templateend="";} $delimiter="&&"; #D6. Get Password Entered by User $checkpassword=$query->param('checkpassword'); #D7. Figure out what action user wants to take. $actiontotake=$query->param('actiontotake'); $linenumberpass=$query->param('linenumberpass'); #D8. 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;} #D9. 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;} #D10. If user wants to edit record, to go subroutine to verify if ($actiontotake eq "Edit"){ &edit; exit;} #D11. If user wants to delete record, to go subroutine to verify if ($actiontotake eq "Delete"){ &delete; exit;} #D12. If user wants to add record, go to add subroutine if ($actiontotake eq "Add"){ &addrecord; exit;} #D13. If user wants to add record to temporary file if ($actiontotake eq "Addtemp"){ &addtemp; exit;} #D14. If owner wants to evaluate records in temp file if ($actiontotake eq "Scrolltemp"){ &scrolltemp; exit;} #D15. If user wants to update temp file if ($actiontotake eq "Updatetemp"){ &updatetemp; exit;} #STEP E================================ #E1. Get the data passed from user $Autoincrement=$query->param('Autoincrement'); $Autoincrementwork=lc($Autoincrement); #E1b. The line below chops characters that cause problems in Perl word searches $Autoincrementwork=~tr/[a-zA-Z0-9 \.\,\?\@\-]/ /cd; if ($Autoincrementwork eq "select"){ $Autoincrementwork=""; $Autoincrement="";} $Autoincrementpass="$Autoincrement"; #E1. Get the data passed from user $Title=$query->param('Title'); $Titlework=lc($Title); #E1b. The line below chops characters that cause problems in Perl word searches $Titlework=~tr/[a-zA-Z0-9 \.\,\?\@\-]/ /cd; if ($Titlework eq "select"){ $Titlework=""; $Title="";} $Titlepass="$Title"; #E1. Get the data passed from user $Category=$query->param('Category'); $Categorywork=lc($Category); #E1b. The line below chops characters that cause problems in Perl word searches $Categorywork=~tr/[a-zA-Z0-9 \.\,\?\@\-]/ /cd; if ($Categorywork eq "select"){ $Categorywork=""; $Category="";} $Categorypass="$Category"; #E1. Get the data passed from user $SubCategory=$query->param('SubCategory'); $SubCategorywork=lc($SubCategory); #E1b. The line below chops characters that cause problems in Perl word searches $SubCategorywork=~tr/[a-zA-Z0-9 \.\,\?\@\-]/ /cd; if ($SubCategorywork eq "select"){ $SubCategorywork=""; $SubCategory="";} $SubCategorypass="$SubCategory"; #E1. Get the data passed from user $Winner=$query->param('Winner'); $Winnerwork=lc($Winner); #E1b. The line below chops characters that cause problems in Perl word searches $Winnerwork=~tr/[a-zA-Z0-9 \.\,\?\@\-]/ /cd; if ($Winnerwork eq "select"){ $Winnerwork=""; $Winner="";} $Winnerpass="$Winner"; #E1. Get the data passed from user $Status=$query->param('Status'); $Statuswork=lc($Status); #E1b. The line below chops characters that cause problems in Perl word searches $Statuswork=~tr/[a-zA-Z0-9 \.\,\?\@\-]/ /cd; if ($Statuswork eq "select"){ $Statuswork=""; $Status="";} $Statuspass="$Status"; #E1. Get the data passed from user $Rank=$query->param('Rank'); $Rankwork=lc($Rank); #E1b. The line below chops characters that cause problems in Perl word searches $Rankwork=~tr/[a-zA-Z0-9 \.\,\?\@\-]/ /cd; if ($Rankwork eq "select"){ $Rankwork=""; $Rank="";} $Rankpass="$Rank"; #E1. Get the data passed from user $Featured=$query->param('Featured'); $Featuredwork=lc($Featured); #E1b. The line below chops characters that cause problems in Perl word searches $Featuredwork=~tr/[a-zA-Z0-9 \.\,\?\@\-]/ /cd; if ($Featuredwork eq "select"){ $Featuredwork=""; $Featured="";} $Featuredpass="$Featured"; #E1. Get the data passed from user $Day=$query->param('Day'); $Daywork=lc($Day); #E1b. The line below chops characters that cause problems in Perl word searches $Daywork=~tr/[a-zA-Z0-9 \.\,\?\@\-]/ /cd; if ($Daywork eq "select"){ $Daywork=""; $Day="";} $Daypass="$Day"; #E1. Get the data passed from user $Month=$query->param('Month'); $Monthwork=lc($Month); #E1b. The line below chops characters that cause problems in Perl word searches $Monthwork=~tr/[a-zA-Z0-9 \.\,\?\@\-]/ /cd; if ($Monthwork eq "select"){ $Monthwork=""; $Month="";} $Monthpass="$Month"; #E1. Get the data passed from user $Year=$query->param('Year'); $Yearwork=lc($Year); #E1b. The line below chops characters that cause problems in Perl word searches $Yearwork=~tr/[a-zA-Z0-9 \.\,\?\@\-]/ /cd; if ($Yearwork eq "select"){ $Yearwork=""; $Year="";} $Yearpass="$Year"; #E1. Get the data passed from user $Link=$query->param('Link'); $Linkwork=lc($Link); #E1b. The line below chops characters that cause problems in Perl word searches $Linkwork=~tr/[a-zA-Z0-9 \.\,\?\@\-]/ /cd; if ($Linkwork eq "select"){ $Linkwork=""; $Link="";} $Linkpass="$Link"; #E1. Get the data passed from user $Credits=$query->param('Credits'); $Creditswork=lc($Credits); #E1b. The line below chops characters that cause problems in Perl word searches $Creditswork=~tr/[a-zA-Z0-9 \.\,\?\@\-]/ /cd; if ($Creditswork eq "select"){ $Creditswork=""; $Credits="";} $Creditspass="$Credits"; #E1. Get the data passed from user $Customer=$query->param('Customer'); $Customerwork=lc($Customer); #E1b. The line below chops characters that cause problems in Perl word searches $Customerwork=~tr/[a-zA-Z0-9 \.\,\?\@\-]/ /cd; if ($Customerwork eq "select"){ $Customerwork=""; $Customer="";} $Customerpass="$Customer"; #E1. Get the data passed from user $ShortDescription=$query->param('ShortDescription'); $ShortDescriptionwork=lc($ShortDescription); #E1b. The line below chops characters that cause problems in Perl word searches $ShortDescriptionwork=~tr/[a-zA-Z0-9 \.\,\?\@\-]/ /cd; if ($ShortDescriptionwork eq "select"){ $ShortDescriptionwork=""; $ShortDescription="";} $ShortDescriptionpass="$ShortDescription"; #E1. Get the data passed from user $LongDescription=$query->param('LongDescription'); $LongDescriptionwork=lc($LongDescription); #E1b. The line below chops characters that cause problems in Perl word searches $LongDescriptionwork=~tr/[a-zA-Z0-9 \.\,\?\@\-]/ /cd; if ($LongDescriptionwork eq "select"){ $LongDescriptionwork=""; $LongDescription="";} $LongDescriptionpass="$LongDescription"; #E1. Get the data passed from user $MetaTitle=$query->param('MetaTitle'); $MetaTitlework=lc($MetaTitle); #E1b. The line below chops characters that cause problems in Perl word searches $MetaTitlework=~tr/[a-zA-Z0-9 \.\,\?\@\-]/ /cd; if ($MetaTitlework eq "select"){ $MetaTitlework=""; $MetaTitle="";} $MetaTitlepass="$MetaTitle"; #E1. Get the data passed from user $MetaKeywords=$query->param('MetaKeywords'); $MetaKeywordswork=lc($MetaKeywords); #E1b. The line below chops characters that cause problems in Perl word searches $MetaKeywordswork=~tr/[a-zA-Z0-9 \.\,\?\@\-]/ /cd; if ($MetaKeywordswork eq "select"){ $MetaKeywordswork=""; $MetaKeywords="";} $MetaKeywordspass="$MetaKeywords"; #E1. Get the data passed from user $MetaDescription=$query->param('MetaDescription'); $MetaDescriptionwork=lc($MetaDescription); #E1b. The line below chops characters that cause problems in Perl word searches $MetaDescriptionwork=~tr/[a-zA-Z0-9 \.\,\?\@\-]/ /cd; if ($MetaDescriptionwork eq "select"){ $MetaDescriptionwork=""; $MetaDescription="";} $MetaDescriptionpass="$MetaDescription"; #E1. Get the data passed from user $Extra1=$query->param('Extra1'); $Extra1work=lc($Extra1); #E1b. The line below chops characters that cause problems in Perl word searches $Extra1work=~tr/[a-zA-Z0-9 \.\,\?\@\-]/ /cd; if ($Extra1work eq "select"){ $Extra1work=""; $Extra1="";} $Extra1pass="$Extra1"; #E1. Get the data passed from user $Extra2=$query->param('Extra2'); $Extra2work=lc($Extra2); #E1b. The line below chops characters that cause problems in Perl word searches $Extra2work=~tr/[a-zA-Z0-9 \.\,\?\@\-]/ /cd; if ($Extra2work eq "select"){ $Extra2work=""; $Extra2="";} $Extra2pass="$Extra2"; #E1. Get the data passed from user $Extra3=$query->param('Extra3'); $Extra3work=lc($Extra3); #E1b. The line below chops characters that cause problems in Perl word searches $Extra3work=~tr/[a-zA-Z0-9 \.\,\?\@\-]/ /cd; if ($Extra3work eq "select"){ $Extra3work=""; $Extra3="";} $Extra3pass="$Extra3"; #E1. Get the data passed from user $Extra4=$query->param('Extra4'); $Extra4work=lc($Extra4); #E1b. The line below chops characters that cause problems in Perl word searches $Extra4work=~tr/[a-zA-Z0-9 \.\,\?\@\-]/ /cd; if ($Extra4work eq "select"){ $Extra4work=""; $Extra4="";} $Extra4pass="$Extra4"; #E1. Get the data passed from user $Extra5=$query->param('Extra5'); $Extra5work=lc($Extra5); #E1b. The line below chops characters that cause problems in Perl word searches $Extra5work=~tr/[a-zA-Z0-9 \.\,\?\@\-]/ /cd; if ($Extra5work eq "select"){ $Extra5work=""; $Extra5="";} $Extra5pass="$Extra5"; #E1. Get the data passed from user $Extra6=$query->param('Extra6'); $Extra6work=lc($Extra6); #E1b. The line below chops characters that cause problems in Perl word searches $Extra6work=~tr/[a-zA-Z0-9 \.\,\?\@\-]/ /cd; if ($Extra6work eq "select"){ $Extra6work=""; $Extra6="";} $Extra6pass="$Extra6"; #E1. Get the data passed from user $Extra7=$query->param('Extra7'); $Extra7work=lc($Extra7); #E1b. The line below chops characters that cause problems in Perl word searches $Extra7work=~tr/[a-zA-Z0-9 \.\,\?\@\-]/ /cd; if ($Extra7work eq "select"){ $Extra7work=""; $Extra7="";} $Extra7pass="$Extra7"; #E1. Get the data passed from user $Extra8=$query->param('Extra8'); $Extra8work=lc($Extra8); #E1b. The line below chops characters that cause problems in Perl word searches $Extra8work=~tr/[a-zA-Z0-9 \.\,\?\@\-]/ /cd; if ($Extra8work eq "select"){ $Extra8work=""; $Extra8="";} $Extra8pass="$Extra8"; #E1. Get the data passed from user $Extra9=$query->param('Extra9'); $Extra9work=lc($Extra9); #E1b. The line below chops characters that cause problems in Perl word searches $Extra9work=~tr/[a-zA-Z0-9 \.\,\?\@\-]/ /cd; if ($Extra9work eq "select"){ $Extra9work=""; $Extra9="";} $Extra9pass="$Extra9"; #E1. Get the data passed from user $Extra10=$query->param('Extra10'); $Extra10work=lc($Extra10); #E1b. The line below chops characters that cause problems in Perl word searches $Extra10work=~tr/[a-zA-Z0-9 \.\,\?\@\-]/ /cd; if ($Extra10work eq "select"){ $Extra10work=""; $Extra10="";} $Extra10pass="$Extra10"; #E6. Get number of records already displayed $startitem=$query->param('startitem'); #E7. Figure the last record to display on this page $enditem=$startitem+$maximumpage; #F4a. Support for European characters. Uncomment and replace with your #character set in brackets for all non-English Characters. See help files. #$Autoincrementwork=~tr/[ÈÉÊËéêëè]/e/; #$Autoincrementwork=~tr/[ÀÁÂÃÄÅÆàáâãäåæ]/a/; #$Autoincrementwork=~tr/[çÇ]/c/; #$Autoincrementwork=~tr/[ìíîïÍÎÏÌ]/i/; #$Autoincrementwork=~tr/[ÒÓÔÕÖòóôõöô]/o/; #$Autoincrementwork=~tr/[ÙÚÛÜùúûü]/u/; ($Autoincrementone, $Autoincrementtwo, $Autoincrementthree, $Autoincrementfour, $Autoincrementfive, $Autoincrementsix, $Autoincrementseven)=split(/ /, $Autoincrementwork); #F4a. Support for European characters. Uncomment and replace with your #character set in brackets for all non-English Characters. See help files. #$Titlework=~tr/[ÈÉÊËéêëè]/e/; #$Titlework=~tr/[ÀÁÂÃÄÅÆàáâãäåæ]/a/; #$Titlework=~tr/[çÇ]/c/; #$Titlework=~tr/[ìíîïÍÎÏÌ]/i/; #$Titlework=~tr/[ÒÓÔÕÖòóôõöô]/o/; #$Titlework=~tr/[ÙÚÛÜùúûü]/u/; ($Titleone, $Titletwo, $Titlethree, $Titlefour, $Titlefive, $Titlesix, $Titleseven)=split(/ /, $Titlework); #F4a. Support for European characters. Uncomment and replace with your #character set in brackets for all non-English Characters. See help files. #$Categorywork=~tr/[ÈÉÊËéêëè]/e/; #$Categorywork=~tr/[ÀÁÂÃÄÅÆàáâãäåæ]/a/; #$Categorywork=~tr/[çÇ]/c/; #$Categorywork=~tr/[ìíîïÍÎÏÌ]/i/; #$Categorywork=~tr/[ÒÓÔÕÖòóôõöô]/o/; #$Categorywork=~tr/[ÙÚÛÜùúûü]/u/; ($Categoryone, $Categorytwo, $Categorythree, $Categoryfour, $Categoryfive, $Categorysix, $Categoryseven)=split(/ /, $Categorywork); #F4a. Support for European characters. Uncomment and replace with your #character set in brackets for all non-English Characters. See help files. #$SubCategorywork=~tr/[ÈÉÊËéêëè]/e/; #$SubCategorywork=~tr/[ÀÁÂÃÄÅÆàáâãäåæ]/a/; #$SubCategorywork=~tr/[çÇ]/c/; #$SubCategorywork=~tr/[ìíîïÍÎÏÌ]/i/; #$SubCategorywork=~tr/[ÒÓÔÕÖòóôõöô]/o/; #$SubCategorywork=~tr/[ÙÚÛÜùúûü]/u/; ($SubCategoryone, $SubCategorytwo, $SubCategorythree, $SubCategoryfour, $SubCategoryfive, $SubCategorysix, $SubCategoryseven)=split(/ /, $SubCategorywork); #F4a. Support for European characters. Uncomment and replace with your #character set in brackets for all non-English Characters. See help files. #$Winnerwork=~tr/[ÈÉÊËéêëè]/e/; #$Winnerwork=~tr/[ÀÁÂÃÄÅÆàáâãäåæ]/a/; #$Winnerwork=~tr/[çÇ]/c/; #$Winnerwork=~tr/[ìíîïÍÎÏÌ]/i/; #$Winnerwork=~tr/[ÒÓÔÕÖòóôõöô]/o/; #$Winnerwork=~tr/[ÙÚÛÜùúûü]/u/; ($Winnerone, $Winnertwo, $Winnerthree, $Winnerfour, $Winnerfive, $Winnersix, $Winnerseven)=split(/ /, $Winnerwork); #F4a. Support for European characters. Uncomment and replace with your #character set in brackets for all non-English Characters. See help files. #$Statuswork=~tr/[ÈÉÊËéêëè]/e/; #$Statuswork=~tr/[ÀÁÂÃÄÅÆàáâãäåæ]/a/; #$Statuswork=~tr/[çÇ]/c/; #$Statuswork=~tr/[ìíîïÍÎÏÌ]/i/; #$Statuswork=~tr/[ÒÓÔÕÖòóôõöô]/o/; #$Statuswork=~tr/[ÙÚÛÜùúûü]/u/; ($Statusone, $Statustwo, $Statusthree, $Statusfour, $Statusfive, $Statussix, $Statusseven)=split(/ /, $Statuswork); #F4a. Support for European characters. Uncomment and replace with your #character set in brackets for all non-English Characters. See help files. #$Rankwork=~tr/[ÈÉÊËéêëè]/e/; #$Rankwork=~tr/[ÀÁÂÃÄÅÆàáâãäåæ]/a/; #$Rankwork=~tr/[çÇ]/c/; #$Rankwork=~tr/[ìíîïÍÎÏÌ]/i/; #$Rankwork=~tr/[ÒÓÔÕÖòóôõöô]/o/; #$Rankwork=~tr/[ÙÚÛÜùúûü]/u/; ($Rankone, $Ranktwo, $Rankthree, $Rankfour, $Rankfive, $Ranksix, $Rankseven)=split(/ /, $Rankwork); #F4a. Support for European characters. Uncomment and replace with your #character set in brackets for all non-English Characters. See help files. #$Featuredwork=~tr/[ÈÉÊËéêëè]/e/; #$Featuredwork=~tr/[ÀÁÂÃÄÅÆàáâãäåæ]/a/; #$Featuredwork=~tr/[çÇ]/c/; #$Featuredwork=~tr/[ìíîïÍÎÏÌ]/i/; #$Featuredwork=~tr/[ÒÓÔÕÖòóôõöô]/o/; #$Featuredwork=~tr/[ÙÚÛÜùúûü]/u/; ($Featuredone, $Featuredtwo, $Featuredthree, $Featuredfour, $Featuredfive, $Featuredsix, $Featuredseven)=split(/ /, $Featuredwork); #F4a. Support for European characters. Uncomment and replace with your #character set in brackets for all non-English Characters. See help files. #$Daywork=~tr/[ÈÉÊËéêëè]/e/; #$Daywork=~tr/[ÀÁÂÃÄÅÆàáâãäåæ]/a/; #$Daywork=~tr/[çÇ]/c/; #$Daywork=~tr/[ìíîïÍÎÏÌ]/i/; #$Daywork=~tr/[ÒÓÔÕÖòóôõöô]/o/; #$Daywork=~tr/[ÙÚÛÜùúûü]/u/; ($Dayone, $Daytwo, $Daythree, $Dayfour, $Dayfive, $Daysix, $Dayseven)=split(/ /, $Daywork); #F4a. Support for European characters. Uncomment and replace with your #character set in brackets for all non-English Characters. See help files. #$Monthwork=~tr/[ÈÉÊËéêëè]/e/; #$Monthwork=~tr/[ÀÁÂÃÄÅÆàáâãäåæ]/a/; #$Monthwork=~tr/[çÇ]/c/; #$Monthwork=~tr/[ìíîïÍÎÏÌ]/i/; #$Monthwork=~tr/[ÒÓÔÕÖòóôõöô]/o/; #$Monthwork=~tr/[ÙÚÛÜùúûü]/u/; ($Monthone, $Monthtwo, $Monththree, $Monthfour, $Monthfive, $Monthsix, $Monthseven)=split(/ /, $Monthwork); #F4a. Support for European characters. Uncomment and replace with your #character set in brackets for all non-English Characters. See help files. #$Yearwork=~tr/[ÈÉÊËéêëè]/e/; #$Yearwork=~tr/[ÀÁÂÃÄÅÆàáâãäåæ]/a/; #$Yearwork=~tr/[çÇ]/c/; #$Yearwork=~tr/[ìíîïÍÎÏÌ]/i/; #$Yearwork=~tr/[ÒÓÔÕÖòóôõöô]/o/; #$Yearwork=~tr/[ÙÚÛÜùúûü]/u/; ($Yearone, $Yeartwo, $Yearthree, $Yearfour, $Yearfive, $Yearsix, $Yearseven)=split(/ /, $Yearwork); #F4a. Support for European characters. Uncomment and replace with your #character set in brackets for all non-English Characters. See help files. #$Linkwork=~tr/[ÈÉÊËéêëè]/e/; #$Linkwork=~tr/[ÀÁÂÃÄÅÆàáâãäåæ]/a/; #$Linkwork=~tr/[çÇ]/c/; #$Linkwork=~tr/[ìíîïÍÎÏÌ]/i/; #$Linkwork=~tr/[ÒÓÔÕÖòóôõöô]/o/; #$Linkwork=~tr/[ÙÚÛÜùúûü]/u/; ($Linkone, $Linktwo, $Linkthree, $Linkfour, $Linkfive, $Linksix, $Linkseven)=split(/ /, $Linkwork); #F4a. Support for European characters. Uncomment and replace with your #character set in brackets for all non-English Characters. See help files. #$Creditswork=~tr/[ÈÉÊËéêëè]/e/; #$Creditswork=~tr/[ÀÁÂÃÄÅÆàáâãäåæ]/a/; #$Creditswork=~tr/[çÇ]/c/; #$Creditswork=~tr/[ìíîïÍÎÏÌ]/i/; #$Creditswork=~tr/[ÒÓÔÕÖòóôõöô]/o/; #$Creditswork=~tr/[ÙÚÛÜùúûü]/u/; ($Creditsone, $Creditstwo, $Creditsthree, $Creditsfour, $Creditsfive, $Creditssix, $Creditsseven)=split(/ /, $Creditswork); #F4a. Support for European characters. Uncomment and replace with your #character set in brackets for all non-English Characters. See help files. #$Customerwork=~tr/[ÈÉÊËéêëè]/e/; #$Customerwork=~tr/[ÀÁÂÃÄÅÆàáâãäåæ]/a/; #$Customerwork=~tr/[çÇ]/c/; #$Customerwork=~tr/[ìíîïÍÎÏÌ]/i/; #$Customerwork=~tr/[ÒÓÔÕÖòóôõöô]/o/; #$Customerwork=~tr/[ÙÚÛÜùúûü]/u/; ($Customerone, $Customertwo, $Customerthree, $Customerfour, $Customerfive, $Customersix, $Customerseven)=split(/ /, $Customerwork); #F4a. Support for European characters. Uncomment and replace with your #character set in brackets for all non-English Characters. See help files. #$ShortDescriptionwork=~tr/[ÈÉÊËéêëè]/e/; #$ShortDescriptionwork=~tr/[ÀÁÂÃÄÅÆàáâãäåæ]/a/; #$ShortDescriptionwork=~tr/[çÇ]/c/; #$ShortDescriptionwork=~tr/[ìíîïÍÎÏÌ]/i/; #$ShortDescriptionwork=~tr/[ÒÓÔÕÖòóôõöô]/o/; #$ShortDescriptionwork=~tr/[ÙÚÛÜùúûü]/u/; ($ShortDescriptionone, $ShortDescriptiontwo, $ShortDescriptionthree, $ShortDescriptionfour, $ShortDescriptionfive, $ShortDescriptionsix, $ShortDescriptionseven)=split(/ /, $ShortDescriptionwork); #F4a. Support for European characters. Uncomment and replace with your #character set in brackets for all non-English Characters. See help files. #$LongDescriptionwork=~tr/[ÈÉÊËéêëè]/e/; #$LongDescriptionwork=~tr/[ÀÁÂÃÄÅÆàáâãäåæ]/a/; #$LongDescriptionwork=~tr/[çÇ]/c/; #$LongDescriptionwork=~tr/[ìíîïÍÎÏÌ]/i/; #$LongDescriptionwork=~tr/[ÒÓÔÕÖòóôõöô]/o/; #$LongDescriptionwork=~tr/[ÙÚÛÜùúûü]/u/; ($LongDescriptionone, $LongDescriptiontwo, $LongDescriptionthree, $LongDescriptionfour, $LongDescriptionfive, $LongDescriptionsix, $LongDescriptionseven)=split(/ /, $LongDescriptionwork); #F4a. Support for European characters. Uncomment and replace with your #character set in brackets for all non-English Characters. See help files. #$MetaTitlework=~tr/[ÈÉÊËéêëè]/e/; #$MetaTitlework=~tr/[ÀÁÂÃÄÅÆàáâãäåæ]/a/; #$MetaTitlework=~tr/[çÇ]/c/; #$MetaTitlework=~tr/[ìíîïÍÎÏÌ]/i/; #$MetaTitlework=~tr/[ÒÓÔÕÖòóôõöô]/o/; #$MetaTitlework=~tr/[ÙÚÛÜùúûü]/u/; ($MetaTitleone, $MetaTitletwo, $MetaTitlethree, $MetaTitlefour, $MetaTitlefive, $MetaTitlesix, $MetaTitleseven)=split(/ /, $MetaTitlework); #F4a. Support for European characters. Uncomment and replace with your #character set in brackets for all non-English Characters. See help files. #$MetaKeywordswork=~tr/[ÈÉÊËéêëè]/e/; #$MetaKeywordswork=~tr/[ÀÁÂÃÄÅÆàáâãäåæ]/a/; #$MetaKeywordswork=~tr/[çÇ]/c/; #$MetaKeywordswork=~tr/[ìíîïÍÎÏÌ]/i/; #$MetaKeywordswork=~tr/[ÒÓÔÕÖòóôõöô]/o/; #$MetaKeywordswork=~tr/[ÙÚÛÜùúûü]/u/; ($MetaKeywordsone, $MetaKeywordstwo, $MetaKeywordsthree, $MetaKeywordsfour, $MetaKeywordsfive, $MetaKeywordssix, $MetaKeywordsseven)=split(/ /, $MetaKeywordswork); #F4a. Support for European characters. Uncomment and replace with your #character set in brackets for all non-English Characters. See help files. #$MetaDescriptionwork=~tr/[ÈÉÊËéêëè]/e/; #$MetaDescriptionwork=~tr/[ÀÁÂÃÄÅÆàáâãäåæ]/a/; #$MetaDescriptionwork=~tr/[çÇ]/c/; #$MetaDescriptionwork=~tr/[ìíîïÍÎÏÌ]/i/; #$MetaDescriptionwork=~tr/[ÒÓÔÕÖòóôõöô]/o/; #$MetaDescriptionwork=~tr/[ÙÚÛÜùúûü]/u/; ($MetaDescriptionone, $MetaDescriptiontwo, $MetaDescriptionthree, $MetaDescriptionfour, $MetaDescriptionfive, $MetaDescriptionsix, $MetaDescriptionseven)=split(/ /, $MetaDescriptionwork); #F4a. Support for European characters. Uncomment and replace with your #character set in brackets for all non-English Characters. See help files. #$Extra1work=~tr/[ÈÉÊËéêëè]/e/; #$Extra1work=~tr/[ÀÁÂÃÄÅÆàáâãäåæ]/a/; #$Extra1work=~tr/[çÇ]/c/; #$Extra1work=~tr/[ìíîïÍÎÏÌ]/i/; #$Extra1work=~tr/[ÒÓÔÕÖòóôõöô]/o/; #$Extra1work=~tr/[ÙÚÛÜùúûü]/u/; ($Extra1one, $Extra1two, $Extra1three, $Extra1four, $Extra1five, $Extra1six, $Extra1seven)=split(/ /, $Extra1work); #F4a. Support for European characters. Uncomment and replace with your #character set in brackets for all non-English Characters. See help files. #$Extra2work=~tr/[ÈÉÊËéêëè]/e/; #$Extra2work=~tr/[ÀÁÂÃÄÅÆàáâãäåæ]/a/; #$Extra2work=~tr/[çÇ]/c/; #$Extra2work=~tr/[ìíîïÍÎÏÌ]/i/; #$Extra2work=~tr/[ÒÓÔÕÖòóôõöô]/o/; #$Extra2work=~tr/[ÙÚÛÜùúûü]/u/; ($Extra2one, $Extra2two, $Extra2three, $Extra2four, $Extra2five, $Extra2six, $Extra2seven)=split(/ /, $Extra2work); #F4a. Support for European characters. Uncomment and replace with your #character set in brackets for all non-English Characters. See help files. #$Extra3work=~tr/[ÈÉÊËéêëè]/e/; #$Extra3work=~tr/[ÀÁÂÃÄÅÆàáâãäåæ]/a/; #$Extra3work=~tr/[çÇ]/c/; #$Extra3work=~tr/[ìíîïÍÎÏÌ]/i/; #$Extra3work=~tr/[ÒÓÔÕÖòóôõöô]/o/; #$Extra3work=~tr/[ÙÚÛÜùúûü]/u/; ($Extra3one, $Extra3two, $Extra3three, $Extra3four, $Extra3five, $Extra3six, $Extra3seven)=split(/ /, $Extra3work); #F4a. Support for European characters. Uncomment and replace with your #character set in brackets for all non-English Characters. See help files. #$Extra4work=~tr/[ÈÉÊËéêëè]/e/; #$Extra4work=~tr/[ÀÁÂÃÄÅÆàáâãäåæ]/a/; #$Extra4work=~tr/[çÇ]/c/; #$Extra4work=~tr/[ìíîïÍÎÏÌ]/i/; #$Extra4work=~tr/[ÒÓÔÕÖòóôõöô]/o/; #$Extra4work=~tr/[ÙÚÛÜùúûü]/u/; ($Extra4one, $Extra4two, $Extra4three, $Extra4four, $Extra4five, $Extra4six, $Extra4seven)=split(/ /, $Extra4work); #F4a. Support for European characters. Uncomment and replace with your #character set in brackets for all non-English Characters. See help files. #$Extra5work=~tr/[ÈÉÊËéêëè]/e/; #$Extra5work=~tr/[ÀÁÂÃÄÅÆàáâãäåæ]/a/; #$Extra5work=~tr/[çÇ]/c/; #$Extra5work=~tr/[ìíîïÍÎÏÌ]/i/; #$Extra5work=~tr/[ÒÓÔÕÖòóôõöô]/o/; #$Extra5work=~tr/[ÙÚÛÜùúûü]/u/; ($Extra5one, $Extra5two, $Extra5three, $Extra5four, $Extra5five, $Extra5six, $Extra5seven)=split(/ /, $Extra5work); #F4a. Support for European characters. Uncomment and replace with your #character set in brackets for all non-English Characters. See help files. #$Extra6work=~tr/[ÈÉÊËéêëè]/e/; #$Extra6work=~tr/[ÀÁÂÃÄÅÆàáâãäåæ]/a/; #$Extra6work=~tr/[çÇ]/c/; #$Extra6work=~tr/[ìíîïÍÎÏÌ]/i/; #$Extra6work=~tr/[ÒÓÔÕÖòóôõöô]/o/; #$Extra6work=~tr/[ÙÚÛÜùúûü]/u/; ($Extra6one, $Extra6two, $Extra6three, $Extra6four, $Extra6five, $Extra6six, $Extra6seven)=split(/ /, $Extra6work); #F4a. Support for European characters. Uncomment and replace with your #character set in brackets for all non-English Characters. See help files. #$Extra7work=~tr/[ÈÉÊËéêëè]/e/; #$Extra7work=~tr/[ÀÁÂÃÄÅÆàáâãäåæ]/a/; #$Extra7work=~tr/[çÇ]/c/; #$Extra7work=~tr/[ìíîïÍÎÏÌ]/i/; #$Extra7work=~tr/[ÒÓÔÕÖòóôõöô]/o/; #$Extra7work=~tr/[ÙÚÛÜùúûü]/u/; ($Extra7one, $Extra7two, $Extra7three, $Extra7four, $Extra7five, $Extra7six, $Extra7seven)=split(/ /, $Extra7work); #F4a. Support for European characters. Uncomment and replace with your #character set in brackets for all non-English Characters. See help files. #$Extra8work=~tr/[ÈÉÊËéêëè]/e/; #$Extra8work=~tr/[ÀÁÂÃÄÅÆàáâãäåæ]/a/; #$Extra8work=~tr/[çÇ]/c/; #$Extra8work=~tr/[ìíîïÍÎÏÌ]/i/; #$Extra8work=~tr/[ÒÓÔÕÖòóôõöô]/o/; #$Extra8work=~tr/[ÙÚÛÜùúûü]/u/; ($Extra8one, $Extra8two, $Extra8three, $Extra8four, $Extra8five, $Extra8six, $Extra8seven)=split(/ /, $Extra8work); #F4a. Support for European characters. Uncomment and replace with your #character set in brackets for all non-English Characters. See help files. #$Extra9work=~tr/[ÈÉÊËéêëè]/e/; #$Extra9work=~tr/[ÀÁÂÃÄÅÆàáâãäåæ]/a/; #$Extra9work=~tr/[çÇ]/c/; #$Extra9work=~tr/[ìíîïÍÎÏÌ]/i/; #$Extra9work=~tr/[ÒÓÔÕÖòóôõöô]/o/; #$Extra9work=~tr/[ÙÚÛÜùúûü]/u/; ($Extra9one, $Extra9two, $Extra9three, $Extra9four, $Extra9five, $Extra9six, $Extra9seven)=split(/ /, $Extra9work); #F4a. Support for European characters. Uncomment and replace with your #character set in brackets for all non-English Characters. See help files. #$Extra10work=~tr/[ÈÉÊËéêëè]/e/; #$Extra10work=~tr/[ÀÁÂÃÄÅÆàáâãäåæ]/a/; #$Extra10work=~tr/[çÇ]/c/; #$Extra10work=~tr/[ìíîïÍÎÏÌ]/i/; #$Extra10work=~tr/[ÒÓÔÕÖòóôõöô]/o/; #$Extra10work=~tr/[ÙÚÛÜùúûü]/u/; ($Extra10one, $Extra10two, $Extra10three, $Extra10four, $Extra10five, $Extra10six, $Extra10seven)=split(/ /, $Extra10work); #STEP G================================ #Do not modify this section #G1. Open datafile and write contents to an array, if can't open report the problem at the security subroutine $problem="You do not have a file to search on the server. Please ADD test records before trying to search your test data file."; open (FILE, "$data") || &security; @all=; close (FILE); #G2. The line below is required, do not modify print "Content-type: text/html\n\n"; #G3. Display HTML Header print "$templatestart\n"; #G5. Show words user searched for #print "You Searched For:
    \n"; #if ($Autoincrement){ #print "
  • Autoincrement\=$Autoincrement\n";} #if ($Title){ #print "
  • Title\=$Title\n";} #if ($Category){ #print "
  • Category\=$Category\n";} #if ($SubCategory){ #print "
  • SubCategory\=$SubCategory\n";} #if ($Winner){ #print "
  • Winner\=$Winner\n";} #if ($Status){ #print "
  • Status\=$Status\n";} #if ($Rank){ #print "
  • Rank\=$Rank\n";} #if ($Featured){ #print "
  • Featured\=$Featured\n";} #if ($Day){ #print "
  • Day\=$Day\n";} #if ($Month){ #print "
  • Month\=$Month\n";} #if ($Year){ #print "
  • Year\=$Year\n";} #if ($Link){ #print "
  • Link\=$Link\n";} #if ($Credits){ #print "
  • Credits\=$Credits\n";} #if ($Customer){ #print "
  • Customer\=$Customer\n";} #if ($ShortDescription){ #print "
  • ShortDescription\=$ShortDescription\n";} #if ($LongDescription){ #print "
  • LongDescription\=$LongDescription\n";} #if ($MetaTitle){ #print "
  • MetaTitle\=$MetaTitle\n";} #if ($MetaKeywords){ #print "
  • MetaKeywords\=$MetaKeywords\n";} #if ($MetaDescription){ #print "
  • MetaDescription\=$MetaDescription\n";} #if ($Extra1){ #print "
  • Extra1\=$Extra1\n";} #if ($Extra2){ #print "
  • Extra2\=$Extra2\n";} #if ($Extra3){ #print "
  • Extra3\=$Extra3\n";} #if ($Extra4){ #print "
  • Extra4\=$Extra4\n";} #if ($Extra5){ #print "
  • Extra5\=$Extra5\n";} #if ($Extra6){ #print "
  • Extra6\=$Extra6\n";} #if ($Extra7){ #print "
  • Extra7\=$Extra7\n";} #if ($Extra8){ #print "
  • Extra8\=$Extra8\n";} #if ($Extra9){ #print "
  • Extra9\=$Extra9\n";} #if ($Extra10){ #print "
  • Extra10\=$Extra10\n";} #print "
\n"; #STEP H================================ #H1. Read each line of the data file, compare with search words foreach $line (@all){ $line=~s/\n//g; $loopsaround++; $checkleng=length($line); if ($checkleng<2){next}; $linetemp1=lc($line); #H1a. Support for European characters. Uncomment and replace with your #character set in brackets for all non-English Characters. See help files. #$linetemp1=~tr/[ÈÉÊËéêëè]/e/; #$linetemp1=~tr/[ÀÁÂÃÄÅÆàáâãäåæ]/a/; #$linetemp1=~tr/[çÇ]/c/; #$linetemp1=~tr/[ìíîïÍÎÏÌ]/i/; #$linetemp1=~tr/[ÒÓÔÕÖòóôõöô]/o/; #$linetemp1=~tr/[ÙÚÛÜùúûü]/u/; ($Autoincrement,$Title,$Category,$SubCategory,$Winner,$Status,$Rank,$Featured,$Day,$Month,$Year,$Link,$Credits,$Customer,$Image_Upload_1,$Image_Upload_2,$Image_Upload_3,$ShortDescription,$LongDescription,$MetaTitle,$MetaKeywords,$MetaDescription,$Extra1,$Extra2,$Extra3,$Extra4,$Extra5,$Extra6,$Extra7,$Extra8,$Extra9,$Extra10,$skipthisfield)=split (/$delimiter/,$linetemp1); #H9. This line specifies the fields to sort results by #See help databases for patches to allow various kinds of sorts $line="$Rank$Year$Month$delimiter$loopsaround$delimiter$line"; #H9.5 This line removes stray leading spaces before sorting your results $line=~s/^ +//; $increcount=0; #H12. Look for matches in field named Autoincrement if (($Autoincrement =~/\b$Autoincrementone/ && $Autoincrement =~/\b$Autoincrementtwo/ && $Autoincrement =~/\b$Autoincrementthree/ && $Autoincrement =~/\b$Autoincrementfour/ && $Autoincrement =~/\b$Autoincrementfive/ && $Autoincrement=~/\b$Autoincrementsix/ && $Autoincrement=~/\b$Autoincrementseven/) || !$Autoincrementwork) { $increcount++;} #H12. Look for matches in field named Title if (($Title =~/\b$Titleone/ && $Title =~/\b$Titletwo/ && $Title =~/\b$Titlethree/ && $Title =~/\b$Titlefour/ && $Title =~/\b$Titlefive/ && $Title=~/\b$Titlesix/ && $Title=~/\b$Titleseven/) || !$Titlework) { $increcount++;} #H12. Look for matches in field named Category if (($Category =~/\b$Categoryone/ && $Category =~/\b$Categorytwo/ && $Category =~/\b$Categorythree/ && $Category =~/\b$Categoryfour/ && $Category =~/\b$Categoryfive/ && $Category=~/\b$Categorysix/ && $Category=~/\b$Categoryseven/) || !$Categorywork) { $increcount++;} #H12. Look for matches in field named SubCategory if (($SubCategory =~/\b$SubCategoryone/ && $SubCategory =~/\b$SubCategorytwo/ && $SubCategory =~/\b$SubCategorythree/ && $SubCategory =~/\b$SubCategoryfour/ && $SubCategory =~/\b$SubCategoryfive/ && $SubCategory=~/\b$SubCategorysix/ && $SubCategory=~/\b$SubCategoryseven/) || !$SubCategorywork) { $increcount++;} #H12. Look for matches in field named Winner if (($Winner =~/\b$Winnerone/ && $Winner =~/\b$Winnertwo/ && $Winner =~/\b$Winnerthree/ && $Winner =~/\b$Winnerfour/ && $Winner =~/\b$Winnerfive/ && $Winner=~/\b$Winnersix/ && $Winner=~/\b$Winnerseven/) || !$Winnerwork) { $increcount++;} #H12. Look for matches in field named Status if (($Status =~/\b$Statusone/ && $Status =~/\b$Statustwo/ && $Status =~/\b$Statusthree/ && $Status =~/\b$Statusfour/ && $Status =~/\b$Statusfive/ && $Status=~/\b$Statussix/ && $Status=~/\b$Statusseven/) || !$Statuswork) { $increcount++;} #H12. Look for matches in field named Rank if (($Rank =~/\b$Rankone/ && $Rank =~/\b$Ranktwo/ && $Rank =~/\b$Rankthree/ && $Rank =~/\b$Rankfour/ && $Rank =~/\b$Rankfive/ && $Rank=~/\b$Ranksix/ && $Rank=~/\b$Rankseven/) || !$Rankwork) { $increcount++;} #H12. Look for matches in field named Featured if (($Featured =~/\b$Featuredone/ && $Featured =~/\b$Featuredtwo/ && $Featured =~/\b$Featuredthree/ && $Featured =~/\b$Featuredfour/ && $Featured =~/\b$Featuredfive/ && $Featured=~/\b$Featuredsix/ && $Featured=~/\b$Featuredseven/) || !$Featuredwork) { $increcount++;} #H12. Look for matches in field named Day if (($Day =~/\b$Dayone/ && $Day =~/\b$Daytwo/ && $Day =~/\b$Daythree/ && $Day =~/\b$Dayfour/ && $Day =~/\b$Dayfive/ && $Day=~/\b$Daysix/ && $Day=~/\b$Dayseven/) || !$Daywork) { $increcount++;} #H12. Look for matches in field named Month if (($Month =~/\b$Monthone/ && $Month =~/\b$Monthtwo/ && $Month =~/\b$Monththree/ && $Month =~/\b$Monthfour/ && $Month =~/\b$Monthfive/ && $Month=~/\b$Monthsix/ && $Month=~/\b$Monthseven/) || !$Monthwork) { $increcount++;} #H12. Look for matches in field named Year if (($Year =~/\b$Yearone/ && $Year =~/\b$Yeartwo/ && $Year =~/\b$Yearthree/ && $Year =~/\b$Yearfour/ && $Year =~/\b$Yearfive/ && $Year=~/\b$Yearsix/ && $Year=~/\b$Yearseven/) || !$Yearwork) { $increcount++;} #H12. Look for matches in field named Link if (($Link =~/\b$Linkone/ && $Link =~/\b$Linktwo/ && $Link =~/\b$Linkthree/ && $Link =~/\b$Linkfour/ && $Link =~/\b$Linkfive/ && $Link=~/\b$Linksix/ && $Link=~/\b$Linkseven/) || !$Linkwork) { $increcount++;} #H12. Look for matches in field named Credits if (($Credits =~/\b$Creditsone/ && $Credits =~/\b$Creditstwo/ && $Credits =~/\b$Creditsthree/ && $Credits =~/\b$Creditsfour/ && $Credits =~/\b$Creditsfive/ && $Credits=~/\b$Creditssix/ && $Credits=~/\b$Creditsseven/) || !$Creditswork) { $increcount++;} #H12. Look for matches in field named Customer if (($Customer =~/\b$Customerone/ && $Customer =~/\b$Customertwo/ && $Customer =~/\b$Customerthree/ && $Customer =~/\b$Customerfour/ && $Customer =~/\b$Customerfive/ && $Customer=~/\b$Customersix/ && $Customer=~/\b$Customerseven/) || !$Customerwork) { $increcount++;} #H12. Look for matches in field named ShortDescription if (($ShortDescription =~/\b$ShortDescriptionone/ && $ShortDescription =~/\b$ShortDescriptiontwo/ && $ShortDescription =~/\b$ShortDescriptionthree/ && $ShortDescription =~/\b$ShortDescriptionfour/ && $ShortDescription =~/\b$ShortDescriptionfive/ && $ShortDescription=~/\b$ShortDescriptionsix/ && $ShortDescription=~/\b$ShortDescriptionseven/) || !$ShortDescriptionwork) { $increcount++;} #H12. Look for matches in field named LongDescription if (($LongDescription =~/\b$LongDescriptionone/ && $LongDescription =~/\b$LongDescriptiontwo/ && $LongDescription =~/\b$LongDescriptionthree/ && $LongDescription =~/\b$LongDescriptionfour/ && $LongDescription =~/\b$LongDescriptionfive/ && $LongDescription=~/\b$LongDescriptionsix/ && $LongDescription=~/\b$LongDescriptionseven/) || !$LongDescriptionwork) { $increcount++;} #H12. Look for matches in field named MetaTitle if (($MetaTitle =~/\b$MetaTitleone/ && $MetaTitle =~/\b$MetaTitletwo/ && $MetaTitle =~/\b$MetaTitlethree/ && $MetaTitle =~/\b$MetaTitlefour/ && $MetaTitle =~/\b$MetaTitlefive/ && $MetaTitle=~/\b$MetaTitlesix/ && $MetaTitle=~/\b$MetaTitleseven/) || !$MetaTitlework) { $increcount++;} #H12. Look for matches in field named MetaKeywords if (($MetaKeywords =~/\b$MetaKeywordsone/ && $MetaKeywords =~/\b$MetaKeywordstwo/ && $MetaKeywords =~/\b$MetaKeywordsthree/ && $MetaKeywords =~/\b$MetaKeywordsfour/ && $MetaKeywords =~/\b$MetaKeywordsfive/ && $MetaKeywords=~/\b$MetaKeywordssix/ && $MetaKeywords=~/\b$MetaKeywordsseven/) || !$MetaKeywordswork) { $increcount++;} #H12. Look for matches in field named MetaDescription if (($MetaDescription =~/\b$MetaDescriptionone/ && $MetaDescription =~/\b$MetaDescriptiontwo/ && $MetaDescription =~/\b$MetaDescriptionthree/ && $MetaDescription =~/\b$MetaDescriptionfour/ && $MetaDescription =~/\b$MetaDescriptionfive/ && $MetaDescription=~/\b$MetaDescriptionsix/ && $MetaDescription=~/\b$MetaDescriptionseven/) || !$MetaDescriptionwork) { $increcount++;} #H12. Look for matches in field named Extra1 if (($Extra1 =~/\b$Extra1one/ && $Extra1 =~/\b$Extra1two/ && $Extra1 =~/\b$Extra1three/ && $Extra1 =~/\b$Extra1four/ && $Extra1 =~/\b$Extra1five/ && $Extra1=~/\b$Extra1six/ && $Extra1=~/\b$Extra1seven/) || !$Extra1work) { $increcount++;} #H12. Look for matches in field named Extra2 if (($Extra2 =~/\b$Extra2one/ && $Extra2 =~/\b$Extra2two/ && $Extra2 =~/\b$Extra2three/ && $Extra2 =~/\b$Extra2four/ && $Extra2 =~/\b$Extra2five/ && $Extra2=~/\b$Extra2six/ && $Extra2=~/\b$Extra2seven/) || !$Extra2work) { $increcount++;} #H12. Look for matches in field named Extra3 if (($Extra3 =~/\b$Extra3one/ && $Extra3 =~/\b$Extra3two/ && $Extra3 =~/\b$Extra3three/ && $Extra3 =~/\b$Extra3four/ && $Extra3 =~/\b$Extra3five/ && $Extra3=~/\b$Extra3six/ && $Extra3=~/\b$Extra3seven/) || !$Extra3work) { $increcount++;} #H12. Look for matches in field named Extra4 if (($Extra4 =~/\b$Extra4one/ && $Extra4 =~/\b$Extra4two/ && $Extra4 =~/\b$Extra4three/ && $Extra4 =~/\b$Extra4four/ && $Extra4 =~/\b$Extra4five/ && $Extra4=~/\b$Extra4six/ && $Extra4=~/\b$Extra4seven/) || !$Extra4work) { $increcount++;} #H12. Look for matches in field named Extra5 if (($Extra5 =~/\b$Extra5one/ && $Extra5 =~/\b$Extra5two/ && $Extra5 =~/\b$Extra5three/ && $Extra5 =~/\b$Extra5four/ && $Extra5 =~/\b$Extra5five/ && $Extra5=~/\b$Extra5six/ && $Extra5=~/\b$Extra5seven/) || !$Extra5work) { $increcount++;} #H12. Look for matches in field named Extra6 if (($Extra6 =~/\b$Extra6one/ && $Extra6 =~/\b$Extra6two/ && $Extra6 =~/\b$Extra6three/ && $Extra6 =~/\b$Extra6four/ && $Extra6 =~/\b$Extra6five/ && $Extra6=~/\b$Extra6six/ && $Extra6=~/\b$Extra6seven/) || !$Extra6work) { $increcount++;} #H12. Look for matches in field named Extra7 if (($Extra7 =~/\b$Extra7one/ && $Extra7 =~/\b$Extra7two/ && $Extra7 =~/\b$Extra7three/ && $Extra7 =~/\b$Extra7four/ && $Extra7 =~/\b$Extra7five/ && $Extra7=~/\b$Extra7six/ && $Extra7=~/\b$Extra7seven/) || !$Extra7work) { $increcount++;} #H12. Look for matches in field named Extra8 if (($Extra8 =~/\b$Extra8one/ && $Extra8 =~/\b$Extra8two/ && $Extra8 =~/\b$Extra8three/ && $Extra8 =~/\b$Extra8four/ && $Extra8 =~/\b$Extra8five/ && $Extra8=~/\b$Extra8six/ && $Extra8=~/\b$Extra8seven/) || !$Extra8work) { $increcount++;} #H12. Look for matches in field named Extra9 if (($Extra9 =~/\b$Extra9one/ && $Extra9 =~/\b$Extra9two/ && $Extra9 =~/\b$Extra9three/ && $Extra9 =~/\b$Extra9four/ && $Extra9 =~/\b$Extra9five/ && $Extra9=~/\b$Extra9six/ && $Extra9=~/\b$Extra9seven/) || !$Extra9work) { $increcount++;} #H12. Look for matches in field named Extra10 if (($Extra10 =~/\b$Extra10one/ && $Extra10 =~/\b$Extra10two/ && $Extra10 =~/\b$Extra10three/ && $Extra10 =~/\b$Extra10four/ && $Extra10 =~/\b$Extra10five/ && $Extra10=~/\b$Extra10six/ && $Extra10=~/\b$Extra10seven/) || !$Extra10work) { $increcount++;} if ($line=~/markedtoedit/ && $actiontotake eq "markedtoedit"){ $line=~s/markedtoedit//g; push (@keepers2,$line);} $line=~s/markedtoedit//g; if ($increcount==29){ push (@keepers,$line);}} #STEP J================================ if ($actiontotake eq "markedtoedit"){ @keepers=@keepers2;} #J1. Sort matches stored in array. @keepers=reverse(sort(@keepers)); #@keepers=sort(@keepers); #J2. Get and display number of matches found $length1=@keepers; #J3. If the number of matches is less than enditem, adjust if ($length1<$enditem){ $enditem=$length1; $displaystat="Y";} #J4. The first field about to display $disstart=$startitem+1; #J5. Show user total number of matches found if ($length1){ #print "$length1 Matches Found (displaying $disstart to $enditem)\n"; print ""; } else { print "Your search found zero photos, please try again.\n";} #STEP K================================ #K1. Do some HTML formatting before showing results $breaktracker=0; print ""; print ""; #K4. Keep track of results processed on this page foreach $line (@keepers){ #K5. Delete stray hard returns $line=~s/\n//g; #K6. Keep track of records displayed $countline1++; $breaktracker++; #K7. Decide whether or not this record goes on this page if ($countline1>$startitem && $countline1<=$enditem){ #K8. Open each line of sorted array for displaying ($sortfield,$loopsaround,$Autoincrement,$Title,$Category,$SubCategory,$Winner,$Status,$Rank,$Featured,$Day,$Month,$Year,$Link,$Credits,$Customer,$Image_Upload_1,$Image_Upload_2,$Image_Upload_3,$ShortDescription,$LongDescription,$MetaTitle,$MetaKeywords,$MetaDescription,$Extra1,$Extra2,$Extra3,$Extra4,$Extra5,$Extra6,$Extra7,$Extra8,$Extra9,$Extra10,$skipthisfield)=split (/$delimiter/,$line); print "\n"; if ($breaktracker == 5){ print "\n"; } if ($breaktracker == 10){ print "\n"; } if ($breaktracker == 15){ print "\n"; } if ($breaktracker == 20){ print "\n"; } if ($breaktracker == 25){ print "\n"; } if ($breaktracker == 30){ print "\n"; } if ($breaktracker == 35){ print "\n"; } if ($breaktracker == 40){ print "\n"; } if ($breaktracker == 45){ print "\n"; } if ($breaktracker == 50){ print "\n"; } if ($breaktracker == 55){ print "\n"; } if ($breaktracker == 60){ print "\n"; } if ($breaktracker == 65){ print "\n"; } if ($breaktracker == 70){ print "\n"; } if ($breaktracker == 75){ print "\n"; } if ($breaktracker == 80){ print "\n"; } if ($breaktracker == 85){ print "\n"; } if ($breaktracker == 90){ print "\n"; } if ($breaktracker == 95){ print "\n"; } if ($breaktracker == 100){ print "\n"; } if ($breaktracker == 105){ print "\n"; } if ($breaktracker == 110){ print "\n"; } if ($breaktracker == 115){ print "\n"; } if ($breaktracker == 120){ print "\n"; } if ($breaktracker == 125){ print "\n"; } if ($breaktracker == 130){ print "\n"; } if ($breaktracker == 135){ print "\n"; } if ($breaktracker == 140){ print "\n"; } if ($breaktracker == 145){ print "\n"; } if ($breaktracker == 150){ print "\n"; } if ($breaktracker == 155){ print "\n"; } if ($breaktracker == 160){ print "\n"; } if ($breaktracker == 165){ print "\n"; } if ($breaktracker == 170){ print "\n"; } if ($breaktracker == 175){ print "\n"; } if ($breaktracker == 180){ print "\n"; } if ($breaktracker == 185){ print "\n"; } if ($breaktracker == 190){ print "\n"; } if ($breaktracker == 195){ print "\n"; } if ($breaktracker == 200){ print "\n"; } if ($breaktracker == 205){ print "\n"; } if ($breaktracker == 210){ print "\n"; } if ($breaktracker == 215){ print "\n"; } if ($breaktracker == 220){ print "\n"; } if ($breaktracker == 225){ print "\n"; } if ($breaktracker == 230){ print "\n"; } if ($breaktracker == 235){ print "\n"; } if ($breaktracker == 240){ print "\n"; } if ($breaktracker == 245){ print "\n"; } if ($breaktracker == 250){ print "\n"; } if ($breaktracker == 255){ print "\n"; } if ($breaktracker == 260){ print "\n"; } if ($breaktracker == 265){ print "\n"; } if ($breaktracker == 270){ print "\n"; } if ($breaktracker == 275){ print "\n"; } if ($breaktracker == 280){ print "\n"; } if ($breaktracker == 285){ print "\n"; } if ($breaktracker == 290){ print "\n"; } if ($breaktracker == 295){ print "\n"; } if ($breaktracker == 300){ print "\n"; } if ($breaktracker == 305){ print "\n"; } if ($breaktracker == 310){ print "\n"; } if ($breaktracker == 315){ print "\n"; } if ($breaktracker == 320){ print "\n"; } if ($breaktracker == 325){ print "\n"; } if ($breaktracker == 330){ print "\n"; } if ($breaktracker == 335){ print "\n"; } if ($breaktracker == 340){ print "\n"; } if ($breaktracker == 345){ print "\n"; } if ($breaktracker == 350){ print "\n"; } if ($breaktracker == 355){ print "\n"; } if ($breaktracker == 360){ print "\n"; } if ($breaktracker == 365){ print "\n"; } if ($breaktracker == 370){ print "\n"; } if ($breaktracker == 375){ print "\n"; } if ($breaktracker == 380){ print "\n"; } if ($breaktracker == 385){ print "\n"; } if ($breaktracker == 390){ print "\n"; } if ($breaktracker == 395){ print "\n"; } if ($breaktracker == 400){ print "\n"; } if ($breaktracker == 405){ print "\n"; } if ($breaktracker == 410){ print "\n"; } if ($breaktracker == 415){ print "\n"; } if ($breaktracker == 420){ print "\n"; } if ($breaktracker == 425){ print "\n"; } if ($breaktracker == 430){ print "\n"; } if ($breaktracker == 435){ print "\n"; } if ($breaktracker == 440){ print "\n"; } if ($breaktracker == 445){ print "\n"; } if ($breaktracker == 450){ print "\n"; } if ($breaktracker == 455){ print "\n"; } if ($breaktracker == 460){ print "\n"; } if ($breaktracker == 465){ print "\n"; } if ($breaktracker == 470){ print "\n"; } if ($breaktracker == 475){ print "\n"; } if ($breaktracker == 480){ print "\n"; } if ($breaktracker == 485){ print "\n"; } if ($breaktracker == 490){ print "\n"; } if ($breaktracker == 495){ print "\n"; } if ($breaktracker == 500){ print "\n"; } #STEP L================================ #L1. 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;} #L2. If script just got to last match then exit program if ($length1 == $countline1){ last;} #L3. 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 "
\"$Title\"
\n"; if ($adminpassword eq $checkpassword){ print "
\n";} print "
"; print "

"; #print "SEND YOUR PHOTO TO US!"; #L4. Display NEXT MATCHES button if ($stopit eq "Y"){ print "
\n"; #L5. Pass hidden variables so script will know how to display next page print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print "
\n"; } #L6. Show problems print "$problem2\n"; #L8. If opening.htm was found, show its closing html codes print "$templateend\n"; exit; #STEP M================================ sub security{ #M1. This is the subroutine that reports all problems print "Content-type: text/html\n\n"; print "$templatestart\n"; print "
Data Error

\n"; print "Please correct the following error:

$problem
\n"; print "$templateend\n"; exit; } #STEP N================================ sub edit{ #N1. Open data file and read it $problem="Can't open data file to read from it at edit subroutine"; open (FILE,"$data") || &security; @all=; close (FILE); #N2. Read each line of the data file foreach $line (@all){ $line=~s/\n//g; ($copyAutoincrement,$copyTitle,$copyCategory,$copySubCategory,$copyWinner,$copyStatus,$copyRank,$copyFeatured,$copyDay,$copyMonth,$copyYear,$copyLink,$copyCredits,$copyCustomer,$copyImage_Upload_1,$copyImage_Upload_2,$copyImage_Upload_3,$copyShortDescription,$copyLongDescription,$copyMetaTitle,$copyMetaKeywords,$copyMetaDescription,$copyExtra1,$copyExtra2,$copyExtra3,$copyExtra4,$copyExtra5,$copyExtra6,$copyExtra7,$copyExtra8,$copyExtra9,$copyExtra10,$skipthisfield)=split (/$delimiter/,$line); $keepcount++; #N3. Find the line user wants to modify if ($keepcount==$linenumberpass){ $linetokeep=$line; $linetokeep=~s/markedtoedit//g; last; } } #N4. Check password sent via hidden field if ($adminpassword ne $checkpassword){ $problem="Your password does not match the master password and appears to have been changed since logging onto this record."; &security;} #N6. Split matching line into its respective variables ($Autoincrement,$Title,$Category,$SubCategory,$Winner,$Status,$Rank,$Featured,$Day,$Month,$Year,$Link,$Credits,$Customer,$Image_Upload_1,$Image_Upload_2,$Image_Upload_3,$ShortDescription,$LongDescription,$MetaTitle,$MetaKeywords,$MetaDescription,$Extra1,$Extra2,$Extra3,$Extra4,$Extra5,$Extra6,$Extra7,$Extra8,$Extra9,$Extra10,$skipthisfield)=split (/$delimiter/,$linetokeep); #Required Header, do not delete print "Content-type: text/html\n\n"; #N8. If can't find opening html, display default header print "$templatestart\n"; print "
EDIT PHOTO

\n"; if ($allowimageuploadonedit || $allowtextuploadonedit){ $allowupload="ENCTYPE=\"multipart/form-data\""; $filetext="FILE";} else{ $filetext="TEXT";} print "
\n"; print "\n"; print "\n"; print "\n"; #print "\n"; print "\n"; #print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; #print "\n"; #print "\n"; $showdelete=""; #if ($Image_Upload_1){ #$showdelete="
Type Delete above to remove this image, leave completely blank to keep the current image."; #} print "\n"; if ($Image_Upload_1){ print "\n"; } $showdelete=""; #if ($Image_Upload_2){ #$showdelete="
Type Delete above to remove this image, leave completely blank to keep the current image."; #} print "\n"; if ($Image_Upload_2){ print "\n"; } $showdelete=""; #if ($Image_Upload_3){ #$showdelete="
Type Delete above to remove this image, leave completely blank to keep the current image."; #} print "\n"; if ($Image_Upload_3){ print "\n"; } #$ShortDescription=~s/
/\n/g; #$ShortDescription=~s/
/\n/g; #print "\n"; $LongDescription=~s/
/\n/g; $LongDescription=~s/
/\n/g; print "\n"; print "\n"; $MetaKeywords=~s/
/\n/g; $MetaKeywords=~s/
/\n/g; print "\n"; $MetaDescription=~s/
/\n/g; $MetaDescription=~s/
/\n/g; print "\n"; #N10. Pass values to next screen print "
Autoincrement:
Title:
Category:
SubCategory:
Winner:
Status:
Rank:
Featured:
Day:
Month:
Year:
Link:
Credits:
Customer:
Image Upload 1:$showdelete
$Image_Upload_1 Check here to delete
Image Upload 2:$showdelete
$Image_Upload_2 Check here to delete
Image Upload 3:$showdelete
$Image_Upload_3 Check here to delete
Short Description:
Long Description:
Meta Title:
Meta Keywords:
MetaDescription:
\n"; print "\n"; print "\n"; print "
\n"; print "
MAIN CONTROL PANEL
\n"; print "$templateend\n"; exit; } #STEP O================================ sub delete{ #O1. Open data file and read it $problem="Can't open data file to read from it at delete subroutine"; open (FILE,"$data") || &security; @all=; close (FILE); #O2. Read each line of the file foreach $line (@all){ $line=~s/\n//g; ($copyAutoincrement,$copyTitle,$copyCategory,$copySubCategory,$copyWinner,$copyStatus,$copyRank,$copyFeatured,$copyDay,$copyMonth,$copyYear,$copyLink,$copyCredits,$copyCustomer,$copyImage_Upload_1,$copyImage_Upload_2,$copyImage_Upload_3,$copyShortDescription,$copyLongDescription,$copyMetaTitle,$copyMetaKeywords,$copyMetaDescription,$copyExtra1,$copyExtra2,$copyExtra3,$copyExtra4,$copyExtra5,$copyExtra6,$copyExtra7,$copyExtra8,$copyExtra9,$copyExtra10,$skipthisfield)=split (/$delimiter/,$line); $keepcount++; #O3. Find line to delete if ($keepcount==$linenumberpass){ $linetokeep=$line; $linetokeep=~s/markedtoedit//g; last; } } ($Autoincrement,$Title,$Category,$SubCategory,$Winner,$Status,$Rank,$Featured,$Day,$Month,$Year,$Link,$Credits,$Customer,$Image_Upload_1,$Image_Upload_2,$Image_Upload_3,$ShortDescription,$LongDescription,$MetaTitle,$MetaKeywords,$MetaDescription,$Extra1,$Extra2,$Extra3,$Extra4,$Extra5,$Extra6,$Extra7,$Extra8,$Extra9,$Extra10,$skipthisfield)=split (/$delimiter/,$linetokeep); #O4. Check password sent via hidden field if ($adminpassword ne $checkpassword){ $problem="Your password does not match the master password."; &security;} #O6. Requred Header, do not delete print "Content-type: text/html\n\n"; print "$templatestart\n"; print "

DELETE PHOTO

\n"; ($Autoincrement,$Title,$Category,$SubCategory,$Winner,$Status,$Rank,$Featured,$Day,$Month,$Year,$Link,$Credits,$Customer,$Image_Upload_1,$Image_Upload_2,$Image_Upload_3,$ShortDescription,$LongDescription,$MetaTitle,$MetaKeywords,$MetaDescription,$Extra1,$Extra2,$Extra3,$Extra4,$Extra5,$Extra6,$Extra7,$Extra8,$Extra9,$Extra10,$skipthisfield)=split (/$delimiter/,$linetokeep); #O7. Show validation HTML print "
\n"; print "\n"; #print "\n"; if (!$Image_Upload_3){ print "\n"; } else{ print "\n"; } print "\n"; print "\n"; #print "\n"; #print "\n"; #print "\n"; #print "\n"; #print "\n"; print "\n"; print "\n"; print "\n"; #print "\n"; #print "\n"; #print "\n"; #print "\n"; if ($deleteonimagerecorddelete=~/y/i && $Image_Upload_1){ print "\n";} #print "\n"; if ($deleteonimagerecorddelete=~/y/i && $Image_Upload_2){ print "\n";} #print "\n"; if ($deleteonimagerecorddelete=~/y/i && $Image_Upload_3){ print "\n";} print "\n"; print "
Autoincrement: $Autoincrement
Title: $Title
Category: $Category
Sub Category: $SubCategory
Winner: $Winner
Status: $Status
Rank: $Rank
Featured: $Featured
Day: $Day
Month: $Month
Year: $Year
Link: $Link
Credits: $Credits
Customer: $Customer
Image_Upload_1: $Image_Upload_1
Image_Upload_2: $Image_Upload_2
Image_Upload_3: $Image_Upload_3
Long Description: $LongDescription

\n"; print "\n"; print "\n"; print "

\n"; print "MAIN CONTROL PANEL
\n"; #If opening.htm was not found, show default closing html codes print "$templateend\n"; exit; } #STEP P================================ sub makechange{ #P1. 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 #Go to get variable subroutine and make sure add preferences apply if ($recordaction eq "Edited"){ &getvariables;} #P2. This step either replaces or empties the existing line if ($recordaction eq "Deleted"){ $Image_Upload_1=$query->param('Image_Upload_1'); if ($Image_Upload_1 && $deleteonimagerecorddelete=~/y/i){ unlink("$Imageuploadpath$Image_Upload_1");} $Image_Upload_2=$query->param('Image_Upload_2'); if ($Image_Upload_2 && $deleteonimagerecorddelete=~/y/i){ unlink("$Imageuploadpath$Image_Upload_2");} $Image_Upload_3=$query->param('Image_Upload_3'); if ($Image_Upload_3 && $deleteonimagerecorddelete=~/y/i){ unlink("$Imageuploadpath$Image_Upload_3");} $replacementline="";} else{ $replacementline="$Autoincrement$delimiter$Title$delimiter$Category$delimiter$SubCategory$delimiter$Winner$delimiter$Status$delimiter$Rank$delimiter$Featured$delimiter$Day$delimiter$Month$delimiter$Year$delimiter$Link$delimiter$Credits$delimiter$Customer$delimiter$Image_Upload_1$delimiter$Image_Upload_2$delimiter$Image_Upload_3$delimiter$ShortDescription$delimiter$LongDescription$delimiter$MetaTitle$delimiter$MetaKeywords$delimiter$MetaDescription$delimiter$Extra1$delimiter$Extra2$delimiter$Extra3$delimiter$Extra4$delimiter$Extra5$delimiter$Extra6$delimiter$Extra7$delimiter$Extra8$delimiter$Extra9$delimiter$Extra10";} $problem="Can't open data file to read from it"; open (FILE,"$data") || &security; @all=; close (FILE); $linenumberpass--; $all[$linenumberpass]=$replacementline; $problem="Can't open temporary file. You need to chmod 777 the directory your data file is in. See the help files under Permissions for Class B Scripts."; #P6. Write the entire changed file to a temporary file open (FILE2,">$data.tmp") || &security; foreach $line (@all){ $line=~s/\n//g; print FILE2 "$line\n";} close(FILE2); #P7. Rename the temp file to your master data file $problem="Can't rename file after making change"; rename("$data.tmp", "$data") || &security; #print "Content-type: text/html\n\n"; #P8. If can't find opening html, display default header #print "$templatestart\n"; print "Location: $forwardingURL\n\n"; close (FILE); #If opening.htm was not found, show default closing html codes print "$templateend\n"; exit; } #STEP Q================================ #This subroutine adds records to your database sub addrecord{ #Q1. 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;} &getvariables; $replacementline="$Autoincrement$delimiter$Title$delimiter$Category$delimiter$SubCategory$delimiter$Winner$delimiter$Status$delimiter$Rank$delimiter$Featured$delimiter$Day$delimiter$Month$delimiter$Year$delimiter$Link$delimiter$Credits$delimiter$Customer$delimiter$Image_Upload_1$delimiter$Image_Upload_2$delimiter$Image_Upload_3$delimiter$ShortDescription$delimiter$LongDescription$delimiter$MetaTitle$delimiter$MetaKeywords$delimiter$MetaDescription$delimiter$Extra1$delimiter$Extra2$delimiter$Extra3$delimiter$Extra4$delimiter$Extra5$delimiter$Extra6$delimiter$Extra7$delimiter$Extra8$delimiter$Extra9$delimiter$Extra10"; #Q3. 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") || &security; print FILE2 "$replacementline\n"; close(FILE2); #print "Content-type: text/html\n\n"; #Q4. If can't find opening html, display default header #print "$templatestart\n"; print "Location: $forwardingURL\n\n"; #If opening.htm was not found, show default closing html codes print "$templateend\n"; exit; } #STEP R================================ sub getvariables{ #R1. This step checks your variables before adding/editing them $Autoincrement=$query->param('Autoincrement'); $Title=$query->param('Title'); $Category=$query->param('Category'); $SubCategory=$query->param('SubCategory'); $Winner=$query->param('Winner'); $Status=$query->param('Status'); $Rank=$query->param('Rank'); $Featured=$query->param('Featured'); $Day=$query->param('Day'); $Month=$query->param('Month'); $Year=$query->param('Year'); $Link=$query->param('Link'); $Credits=$query->param('Credits'); $Customer=$query->param('Customer'); $Image_Upload_1=$query->param('Image_Upload_1'); $Image_Upload_2=$query->param('Image_Upload_2'); $Image_Upload_3=$query->param('Image_Upload_3'); $ShortDescription=$query->param('ShortDescription'); $LongDescription=$query->param('LongDescription'); $MetaTitle=$query->param('MetaTitle'); $MetaKeywords=$query->param('MetaKeywords'); $MetaDescription=$query->param('MetaDescription'); $Extra1=$query->param('Extra1'); $Extra2=$query->param('Extra2'); $Extra3=$query->param('Extra3'); $Extra4=$query->param('Extra4'); $Extra5=$query->param('Extra5'); $Extra6=$query->param('Extra6'); $Extra7=$query->param('Extra7'); $Extra8=$query->param('Extra8'); $Extra9=$query->param('Extra9'); $Extra10=$query->param('Extra10'); #R3. Replace hard returns with
, cut carriage returns $Autoincrement=~s/\n/
/g; $Autoincrement=~s/\r//g; if ($Autoincrement eq "Select"){ $Autoincrement="";} #R3. Replace hard returns with
, cut carriage returns $Title=~s/\n/
/g; $Title=~s/\r//g; if ($Title eq "Select"){ $Title="";} #R3. Replace hard returns with
, cut carriage returns $Category=~s/\n/
/g; $Category=~s/\r//g; if ($Category eq "Select"){ $Category="";} #R3. Replace hard returns with
, cut carriage returns $SubCategory=~s/\n/
/g; $SubCategory=~s/\r//g; if ($SubCategory eq "Select"){ $SubCategory="";} #R3. Replace hard returns with
, cut carriage returns $Winner=~s/\n/
/g; $Winner=~s/\r//g; if ($Winner eq "Select"){ $Winner="";} #R3. Replace hard returns with
, cut carriage returns $Status=~s/\n/
/g; $Status=~s/\r//g; if ($Status eq "Select"){ $Status="";} #R3. Replace hard returns with
, cut carriage returns $Rank=~s/\n/
/g; $Rank=~s/\r//g; if ($Rank eq "Select"){ $Rank="";} #R3. Replace hard returns with
, cut carriage returns $Featured=~s/\n/
/g; $Featured=~s/\r//g; if ($Featured eq "Select"){ $Featured="";} #R3. Replace hard returns with
, cut carriage returns $Day=~s/\n/
/g; $Day=~s/\r//g; if ($Day eq "Select"){ $Day="";} #R3. Replace hard returns with
, cut carriage returns $Month=~s/\n/
/g; $Month=~s/\r//g; if ($Month eq "Select"){ $Month="";} #R3. Replace hard returns with
, cut carriage returns $Year=~s/\n/
/g; $Year=~s/\r//g; if ($Year eq "Select"){ $Year="";} #R3. Replace hard returns with
, cut carriage returns $Link=~s/\n/
/g; $Link=~s/\r//g; if ($Link eq "Select"){ $Link="";} #R3. Replace hard returns with
, cut carriage returns $Credits=~s/\n/
/g; $Credits=~s/\r//g; if ($Credits eq "Select"){ $Credits="";} #R3. Replace hard returns with
, cut carriage returns $Customer=~s/\n/
/g; $Customer=~s/\r//g; if ($Customer eq "Select"){ $Customer="";} #R3. Replace hard returns with
, cut carriage returns $Image_Upload_1=~s/\n/
/g; $Image_Upload_1=~s/\r//g; if ($Image_Upload_1 eq "Select"){ $Image_Upload_1="";} #R3. Replace hard returns with
, cut carriage returns $Image_Upload_2=~s/\n/
/g; $Image_Upload_2=~s/\r//g; if ($Image_Upload_2 eq "Select"){ $Image_Upload_2="";} #R3. Replace hard returns with
, cut carriage returns $Image_Upload_3=~s/\n/
/g; $Image_Upload_3=~s/\r//g; if ($Image_Upload_3 eq "Select"){ $Image_Upload_3="";} #R3. Replace hard returns with
, cut carriage returns $ShortDescription=~s/\n/
/g; $ShortDescription=~s/\r//g; if ($ShortDescription eq "Select"){ $ShortDescription="";} #R3. Replace hard returns with
, cut carriage returns $LongDescription=~s/\n/
/g; $LongDescription=~s/\r//g; if ($LongDescription eq "Select"){ $LongDescription="";} #R3. Replace hard returns with
, cut carriage returns $MetaTitle=~s/\n/
/g; $MetaTitle=~s/\r//g; if ($MetaTitle eq "Select"){ $MetaTitle="";} #R3. Replace hard returns with
, cut carriage returns $MetaKeywords=~s/\n/
/g; $MetaKeywords=~s/\r//g; if ($MetaKeywords eq "Select"){ $MetaKeywords="";} #R3. Replace hard returns with
, cut carriage returns $MetaDescription=~s/\n/
/g; $MetaDescription=~s/\r//g; if ($MetaDescription eq "Select"){ $MetaDescription="";} #R3. Replace hard returns with
, cut carriage returns $Extra1=~s/\n/
/g; $Extra1=~s/\r//g; if ($Extra1 eq "Select"){ $Extra1="";} #R3. Replace hard returns with
, cut carriage returns $Extra2=~s/\n/
/g; $Extra2=~s/\r//g; if ($Extra2 eq "Select"){ $Extra2="";} #R3. Replace hard returns with
, cut carriage returns $Extra3=~s/\n/
/g; $Extra3=~s/\r//g; if ($Extra3 eq "Select"){ $Extra3="";} #R3. Replace hard returns with
, cut carriage returns $Extra4=~s/\n/
/g; $Extra4=~s/\r//g; if ($Extra4 eq "Select"){ $Extra4="";} #R3. Replace hard returns with
, cut carriage returns $Extra5=~s/\n/
/g; $Extra5=~s/\r//g; if ($Extra5 eq "Select"){ $Extra5="";} #R3. Replace hard returns with
, cut carriage returns $Extra6=~s/\n/
/g; $Extra6=~s/\r//g; if ($Extra6 eq "Select"){ $Extra6="";} #R3. Replace hard returns with
, cut carriage returns $Extra7=~s/\n/
/g; $Extra7=~s/\r//g; if ($Extra7 eq "Select"){ $Extra7="";} #R3. Replace hard returns with
, cut carriage returns $Extra8=~s/\n/
/g; $Extra8=~s/\r//g; if ($Extra8 eq "Select"){ $Extra8="";} #R3. Replace hard returns with
, cut carriage returns $Extra9=~s/\n/
/g; $Extra9=~s/\r//g; if ($Extra9 eq "Select"){ $Extra9="";} #R3. Replace hard returns with
, cut carriage returns $Extra10=~s/\n/
/g; $Extra10=~s/\r//g; if ($Extra10 eq "Select"){ $Extra10="";} if ($actiontotake!~/edit/i || !$Autoincrement){ $count=0; $problem="Unable to open or create the counter file at $counterfile, please check the path to the file."; open (COUNTER, "$counterfile") || open (COUNTER, ">>$counterfile") || &security; $count=; close(COUNTER); if ($count=~ /\n$/) { chop($count); } $count++; $problem="Unable to write to counter file at $counterfile. Please check the path to the file and make sure that it is chmod 766 or 777."; open (COUNTER,">$counterfile") || &error; print COUNTER "$count"; close (COUNTER); #Make all numbers six digit for proper sorting if (length($count)==1){ $Autoincrement="00000$count";} if (length($count)==2){ $Autoincrement="0000$count";} if (length($count)==3){ $Autoincrement="000$count";} if (length($count)==4){ $Autoincrement="00$count";} if (length($count)==5){ $Autoincrement="0$count";} } #New routines added 6/29/06 to support Firefox and Mac file name upload formats $checkcontent=0; ($fn,$et)=split(/./,$Image_Upload_1); $fn2=$fn; $fn2=~tr/[0-9]//cd; #Checks to make sure that a filename was provided and that it's not a 9-10 digit #number similar to our upload renaming scheme. Find problems, let us know if ($fn && length($fn2!=9) && length($fn2!=10)){ $checkcontent=1;} if (($Image_Upload_1=~/\\/ || $Image_Upload_1=~/\:/ || $checkcontent) && $Image_Upload_1 !~/delete/i){ $containsimageImage_Upload_1=1; #Get Unix time. Will constitute file name if (!$tstamp){ $tstamp=time;} else{ $tstamp++;} @splitparts=split(/\./,$Image_Upload_1); $parts=@splitparts; $parts--; $extension=lc($splitparts[$parts]); if ($extension!~/gif|jpg|jpeg/i){ $problem="You are attempting to upload a file with an incorrect extension .$splitparts[$parts]. For security reasons, only image files .gif, .jpg, or .jpeg extensions can be uploaded."; &security; } if ($Image_Upload_1=~/\.cgi|\.pl|\.exe/i){ $problem="You are attempting to upload a file that could be hazardous to the server. Please make sure that you upload only files with .gif, .jpg, or .jpeg extensions. .pl or .cgi can't make up any part of the filename you are uploading."; &security; } $Imagemaximum=$Imagemaxz*1024; $size=-1024; $problem="Can't write the image to the directory . Make sure that you have set the permissions for this directory so that it is writeable and that you have specified a valid directory path."; open (OUTFILE,">$Imageuploadpath$tstamp.$extension") || &security; while ($bytesread=read($Image_Upload_1,$buffer,1024)) { $size=$size+1024; if ($size>$Imagemaximum){ $problem="You are attempting to upload a file that is too large. Please decrease the size of the image and try again."; close(OUTFILE); unlink("$Imageuploadpath$tstamp.$extension"); &security; } #On Windows servers, uncomment the following line #binmode(OUTFILE); print OUTFILE $buffer;} close(OUTFILE); $Image_Upload_1checksize=-s "$Imageuploadpath$tstamp.$extension"; if ($Image_Upload_1checksize<5){ $problem="Unable to upload the image in field $Image_Upload_1. Your server configuration may not be compatible with this feature or your browser was not able to find the file that you pointed it to."; $imageerror=1; } if ($imageerror){ unlink("$Imageuploadpath$tstamp.$extension"); &security;} $Image_Upload_1="$tstamp.$extension"; } $Image_Upload_1delete=$query->param('Image_Upload_1b'); if (!$Image_Upload_1 && $Image_Upload_1delete){ unlink("$Imageuploadpath$Image_Upload_1delete"); } elsif (!$containsimageImage_Upload_1 && $actiontotake=~/edit/i){ $Image_Upload_1=$query->param('Image_Upload_1bb');} #New routines added 6/29/06 to support Firefox and Mac file name upload formats $checkcontent=0; ($fn,$et)=split(/./,$Image_Upload_2); $fn2=$fn; $fn2=~tr/[0-9]//cd; #Checks to make sure that a filename was provided and that it's not a 9-10 digit #number similar to our upload renaming scheme. Find problems, let us know if ($fn && length($fn2!=9) && length($fn2!=10)){ $checkcontent=1;} if (($Image_Upload_2=~/\\/ || $Image_Upload_2=~/\:/ || $checkcontent) && $Image_Upload_2 !~/delete/i){ $containsimageImage_Upload_2=1; #Get Unix time. Will constitute file name if (!$tstamp){ $tstamp=time;} else{ $tstamp++;} @splitparts=split(/\./,$Image_Upload_2); $parts=@splitparts; $parts--; $extension=lc($splitparts[$parts]); if ($extension!~/gif|jpg|jpeg/i){ $problem="You are attempting to upload a file with an incorrect extension .$splitparts[$parts]. For security reasons, only image files .gif, .jpg, or .jpeg extensions can be uploaded."; &security; } if ($Image_Upload_2=~/\.cgi|\.pl|\.exe/i){ $problem="You are attempting to upload a file that could be hazardous to the server. Please make sure that you upload only files with .gif, .jpg, or .jpeg extensions. .pl or .cgi can't make up any part of the filename you are uploading."; &security; } $Imagemaximum=$Imagemaxz*3200; $size=-3200; $problem="Can't write the image to the directory . Make sure that you have set the permissions for this directory so that it is writeable and that you have specified a valid directory path."; open (OUTFILE,">$Imageuploadpath$tstamp.$extension") || &security; while ($bytesread=read($Image_Upload_2,$buffer,3200)) { $size=$size+3200; if ($size>$Imagemaximum){ $problem="You are attempting to upload a file that is too large. Please decrease the size of the image and try again."; close(OUTFILE); unlink("$Imageuploadpath$tstamp.$extension"); &security; } #On Windows servers, uncomment the following line #binmode(OUTFILE); print OUTFILE $buffer;} close(OUTFILE); $Image_Upload_2checksize=-s "$Imageuploadpath$tstamp.$extension"; if ($Image_Upload_2checksize<5){ $problem="Unable to upload the image in field $Image_Upload_2. Your server configuration may not be compatible with this feature or your browser was not able to find the file that you pointed it to."; $imageerror=1; } if ($imageerror){ unlink("$Imageuploadpath$tstamp.$extension"); &security;} $Image_Upload_2="$tstamp.$extension"; } $Image_Upload_2delete=$query->param('Image_Upload_2b'); if (!$Image_Upload_2 && $Image_Upload_2delete){ unlink("$Imageuploadpath$Image_Upload_2delete"); } elsif (!$containsimageImage_Upload_2 && $actiontotake=~/edit/i){ $Image_Upload_2=$query->param('Image_Upload_2bb');} #New routines added 6/29/06 to support Firefox and Mac file name upload formats $checkcontent=0; ($fn,$et)=split(/./,$Image_Upload_3); $fn2=$fn; $fn2=~tr/[0-9]//cd; #Checks to make sure that a filename was provided and that it's not a 9-10 digit #number similar to our upload renaming scheme. Find problems, let us know if ($fn && length($fn2!=9) && length($fn2!=10)){ $checkcontent=1;} if (($Image_Upload_3=~/\\/ || $Image_Upload_3=~/\:/ || $checkcontent) && $Image_Upload_3 !~/delete/i){ $containsimageImage_Upload_3=1; #Get Unix time. Will constitute file name if (!$tstamp){ $tstamp=time;} else{ $tstamp++;} @splitparts=split(/\./,$Image_Upload_3); $parts=@splitparts; $parts--; $extension=lc($splitparts[$parts]); if ($extension!~/gif|jpg|jpeg/i){ $problem="You are attempting to upload a file with an incorrect extension .$splitparts[$parts]. For security reasons, only image files .gif, .jpg, or .jpeg extensions can be uploaded."; &security; } if ($Image_Upload_3=~/\.cgi|\.pl|\.exe/i){ $problem="You are attempting to upload a file that could be hazardous to the server. Please make sure that you upload only files with .gif, .jpg, or .jpeg extensions. .pl or .cgi can't make up any part of the filename you are uploading."; &security; } $Imagemaximum=$Imagemaxz*1024; $size=-1024; $problem="Can't write the image to the directory . Make sure that you have set the permissions for this directory so that it is writeable and that you have specified a valid directory path."; open (OUTFILE,">$Imageuploadpath$tstamp.$extension") || &security; while ($bytesread=read($Image_Upload_3,$buffer,1024)) { $size=$size+1024; if ($size>$Imagemaximum){ $problem="You are attempting to upload a file that is too large. Please decrease the size of the image and try again."; close(OUTFILE); unlink("$Imageuploadpath$tstamp.$extension"); &security; } #On Windows servers, uncomment the following line #binmode(OUTFILE); print OUTFILE $buffer;} close(OUTFILE); $Image_Upload_3checksize=-s "$Imageuploadpath$tstamp.$extension"; if ($Image_Upload_3checksize<5){ $problem="Unable to upload the image in field $Image_Upload_3. Your server configuration may not be compatible with this feature or your browser was not able to find the file that you pointed it to."; $imageerror=1; } if ($imageerror){ unlink("$Imageuploadpath$tstamp.$extension"); &security;} $Image_Upload_3="$tstamp.$extension"; } $Image_Upload_3delete=$query->param('Image_Upload_3b'); if (!$Image_Upload_3 && $Image_Upload_3delete){ unlink("$Imageuploadpath$Image_Upload_3delete"); } elsif (!$containsimageImage_Upload_3 && $actiontotake=~/edit/i){ $Image_Upload_3=$query->param('Image_Upload_3bb');} } #STEP S================================ sub addtemp{ #S1. This subroutine adds records to your temporary file for approval #S2. Check variable sent &getvariables; #S3. Randomize in preparation for random generator srand(); #S4. Get IP address of person posting record $ipstamp=$ENV{'REMOTE_ADDR'}; #S5. Generate a large random number to serve as key $randnumb=int(rand(9999999)); $replacementline="$ipstamp&&temp$randnumb(\+\+)$Autoincrement$delimiter$Title$delimiter$Category$delimiter$SubCategory$delimiter$Winner$delimiter$Status$delimiter$Rank$delimiter$Featured$delimiter$Day$delimiter$Month$delimiter$Year$delimiter$Link$delimiter$Credits$delimiter$Customer$delimiter$Image_Upload_1$delimiter$Image_Upload_2$delimiter$Image_Upload_3$delimiter$ShortDescription$delimiter$LongDescription$delimiter$MetaTitle$delimiter$MetaKeywords$delimiter$MetaDescription$delimiter$Extra1$delimiter$Extra2$delimiter$Extra3$delimiter$Extra4$delimiter$Extra5$delimiter$Extra6$delimiter$Extra7$delimiter$Extra8$delimiter$Extra9$delimiter$Extra10"; #S6. Write the temp record to the bottom of the $problem="Can't write to the data file. Please verify its location and change its permissions to 777."; open (FILE2,">>$tempdata") || &security; print FILE2 "$replacementline\n"; close(FILE2); print "Content-type: text/html\n\n"; print "$templatestart\n"; #S7. Acknowledge that record has been posted print "Your record has been sent for evaluation. Please click here to continue.\n"; print "$templateend\n"; exit; } #STEP T================================ sub scrolltemp{ #T1. This step is your interface with the temp file #T2. 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;} #T3. Check to make sure that the data file can be opened. $problem="Unable to open your temporary data file. It either contains no records, or the path to it is incorrect."; open (FILE, "$tempdata") || &security; @all=; close (FILE); print "Content-type: text/html\n\n"; #T4. Start showing contents of data file print "$templatestart\n"; print "
\n"; $checktemp=@all; if (!$checktemp){ print "Your temporary file contains no records for you to evaluate at this time. Please click here to continue.

\n"; print "$templateend\n"; exit;} print "\n"; foreach $line (@all){ $line=~s/\n//g; $checkleng=length($line); if ($checkleng<2){next}; ($indexvalues,$stringvalues)=split(/\(\+\+\)/,$line); ($ipaddress,$uniqueapproval)=split(/&&/,$indexvalues); ($Autoincrement,$Title,$Category,$SubCategory,$Winner,$Status,$Rank,$Featured,$Day,$Month,$Year,$Link,$Credits,$Customer,$Image_Upload_1,$Image_Upload_2,$Image_Upload_3,$ShortDescription,$LongDescription,$MetaTitle,$MetaKeywords,$MetaDescription,$Extra1,$Extra2,$Extra3,$Extra4,$Extra5,$Extra6,$Extra7,$Extra8,$Extra9,$Extra10,$skipthisfield)=split (/$delimiter/,$stringvalues); print "\n"; print "\n"; #print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; $keeptrack2++; if ($keeptrack2>10){ last}; } print "
AddDelEditHold
    Autoincrement:$Autoincrement
    Title:$Title
    Day:$Day
    Month:$Month
    Year:$Year
    Link:$Link
    Image Upload 3:$Image_Upload_3
    Long Description:$LongDescription

\n"; if ($keeptrack2>=10){ print "

\n";} else{ print "\n";} print "
MAIN CONTROL PANEL\n"; print "$templateend\n"; exit; } #STEP U================================ sub updatetemp{ #U1. This step makes changes from temp file #U2. 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;} $problem="Unable to open your temporary data file. It either contains no records, or the path to it is incorrect."; open (FILE, "$tempdata") || &security; @all=; close (FILE); foreach $line (@all){ $line=~s/\n//g; $checkleng=length($line); if ($checkleng<2){next}; ($indexvalues,$stringvalues)=split(/\(\+\+\)/,$line); ($ipaddress,$uniqueapproval)=split(/&&/,$indexvalues); ($Autoincrement,$Title,$Category,$SubCategory,$Winner,$Status,$Rank,$Featured,$Day,$Month,$Year,$Link,$Credits,$Customer,$Image_Upload_1,$Image_Upload_2,$Image_Upload_3,$ShortDescription,$LongDescription,$MetaTitle,$MetaKeywords,$MetaDescription,$Extra1,$Extra2,$Extra3,$Extra4,$Extra5,$Extra6,$Extra7,$Extra8,$Extra9,$Extra10,$skipthisfield)=split (/$delimiter/,$stringvalues); if ($tempapprove{$uniqueapproval} eq "A"){ push(@recordstoadd,$stringvalues);} elsif ($tempapprove{$uniqueapproval} eq "D"){ push(@recordstodelete,$stringvalues);} elsif ($tempapprove{$uniqueapproval} eq "E"){ push(@recordstoedit,$stringvalues);} else { push(@recordstohold,$line);} } $problem="Unable to open data file to add records. Check path to it and its permissions."; open (FILE, ">>$data") || &security; foreach $line (@recordstoadd){ $line=~s/\n//g; print FILE "$line\n";} close(FILE); $problem="Unable to open data file to records to edit. Check path to it and its permissions."; open (FILE, ">>$data") || &security; foreach $line (@recordstoedit){ $line=~s/\n//g; print FILE "markedtoedit$line\n";} close(FILE); $problem="Unable to open temporary file to refresh data. Check path to it and its permissions."; open (FILE, ">$tempdata") || &security; foreach $line (@recordstohold){ $line=~s/\n//g; print FILE "$line\n";} close(FILE); $checkhold=@recordstohold; if ($checkhold){ &scrolltemp;} print "Content-type: text/html\n\n"; print "$templatestart\n"; print "

Your actions have been taken. Please click here to continue.

\n"; print "$templateend\n"; exit; } #This is the last line of the script