#!/usr/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. #The first two characters of the first line of your script #should read #! and should be completely flush with the #left margin. If this is not the case, then it is likely that #your web browser tried to convert this text file to a web page #and reformatted this page, which will make it unusable, an #error common with MS Internet Explorer. Redownload this file #as a text file, not an HTML file. #(c)FLATTEXT Database Scripts 1997-2002 use CGI; $query = new CGI; #You need to modify this script at all parts of Step B #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. Or, contact your #server administrator #Script Description #Unique script ID: 26c9-d5a6 #Created on: 3/15/2004 #Last edited on: 10/31/2006 #Script class: D #You can edit this script on our server any time up to two years #after it was first created or last edited. The values that you used #to create this script will be loaded and you can change the #configurations as needed. Any edits you make to this script offline #should be marked with comments so that you can easily find them and #transfer them to any upgraded scripts you create #See http://flattext.com #STEP A================================ #SCRIPT USAGE #This is FLATTEXT 7.0, released March 1, 2002 #COPYRIGHT NOTICE #FLATTEXT License for Regular Scripts #All FLATTEXT scripts are copyright (c) FLATTEXT Database #Scripts, Inc. 1997-2006. Legally, you must retain the copyright #line inside the script. You are free to remove the printed #"Search results by FLATTEXT" text that appears inside Step #L of your script (see below), but under no circumstances #should the copyright assignment line (above) be removed. #Each script is licensed for use on a single computer or #server. Running multiple versions of the same script, or #continually editing the same script for different uses is #not permitted. Each implementation of the script requires #a new license (exceptions to this are those who have #purchased a Developer License, or those who have made #separate and written arrangements with us). All scripts #created by Developer License holders are automatically #licensed. #By using any of our scripts, you agree not to hold us #liable for any lost data, time, or any other costs #directly or indirectly associated with the use of our product. #Many of the common problems are addressed in the help #files at: #http://flattext.com/help/ #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; #STEP B================================ #You MUST modify each of the variables in this this section #B1. REQUIRED: The location of the 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="D:/Domains/specialists-in-seating.co.uk/wwwroot/data/gallery.txt"; #B1b. REQUIRED: The location of your temporary data file on your server. #Must be the PATH to your temporary data data file, not the URL. Use a file #extension other than .tmp to avoid possible conflicts within script $tempdata="D:/Domains/specialists-in-seating.co.uk/wwwroot/data/gallerytemp.txt"; #B2. REQUIRED: The URL of this script file in your cgi-bin directory. #You can provide the full URL, beginning with http:// (or, you can #simply use the filename, i.e. "database.cgi") $thisurl="gallery.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/ #Note, you are providing a full or relative server PATH here. A #URL will not work. $openinghtml="D:/Domains/specialists-in-seating.co.uk/wwwroot/Templates/gallery.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="000"; #B5. URL to send users to after posting, editing, or getting errors. #This is usually the main page for this section of your site $forwardingURL="../adminarea/"; #B42. Please provide the path to the directory where #your upload images will go. Depending on server configuration, #you may need to chmod 777 this directory, to make it writeable. #The path you are providing below should end with a forwardslash. #This feature is inherently INSECURE and opens a wide range of #SECURITY issues, many of them very serious. You are highly encouraged #to direct all uploads to a nonpublic directory and then move them #to a public directory only after you have evaluated the files. #Use at your own risk. This feature may not be compatible with #your server. NEVER ALLOW UPLOADS INTO (or subdirectory of) #YOUR CGI-BIN DIRECTORY! Please note that you are providing #a full or relative system PATH. A URL will not work here. $Imageuploadpath="D:/Domains/specialists-in-seating.co.uk/wwwroot/galleryimages/"; #B43. Please provide the URL to the directory where your #your uploaded images will be located. Note that this must be a #full URL beginning with http:// for the directory only! Forwardslash #at end of the URL is required $ImageuploadURL="D:/Domains/specialists-in-seating.co.uk/wwwroot/galleryimages/"; #B44. Please specify the largest file for the image upload #that you are willing to permit. This value is in KB, so use numbers #like 50 for 50KB. Never set the number above 100 $Imagemaxz="300"; #B45. Do you want to allow images to be changed while in edit #mode? Select Y for Yes or N for No $allowimageuploadonedit="Y"; #B46. Do you want to delete the images when you delete the #corresponding record. Select Y for Yes or N for No $deleteonimagerecorddelete="Y"; #STEP C================================ #C1. Maximum number of matching records to display per page $maximumpage=25; #C2. Maximum total number of records to display per search, #for stylistic reasons, should be multiple of above number $maximum=250; @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="\t"; #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 $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 $Sub_Category=$query->param('Sub_Category'); $Sub_Categorywork=lc($Sub_Category); #E1b. The line below chops characters that cause problems in Perl word searches $Sub_Categorywork=~tr/[a-zA-Z0-9 \.\,\?\@\-]/ /cd; if ($Sub_Categorywork eq "select"){ $Sub_Categorywork=""; $Sub_Category="";} $Sub_Categorypass="$Sub_Category"; #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 $Job_Brief=$query->param('Job_Brief'); $Job_Briefwork=lc($Job_Brief); #E1b. The line below chops characters that cause problems in Perl word searches $Job_Briefwork=~tr/[a-zA-Z0-9 \.\,\?\@\-]/ /cd; if ($Job_Briefwork eq "select"){ $Job_Briefwork=""; $Job_Brief="";} $Job_Briefpass="$Job_Brief"; #E1. Get the data passed from user $Work_Carried_Out=$query->param('Work_Carried_Out'); $Work_Carried_Outwork=lc($Work_Carried_Out); #E1b. The line below chops characters that cause problems in Perl word searches $Work_Carried_Outwork=~tr/[a-zA-Z0-9 \.\,\?\@\-]/ /cd; if ($Work_Carried_Outwork eq "select"){ $Work_Carried_Outwork=""; $Work_Carried_Out="";} $Work_Carried_Outpass="$Work_Carried_Out"; #E1. Get the data passed from user $Related_Job_1=$query->param('Related_Job_1'); $Related_Job_1work=lc($Related_Job_1); #E1b. The line below chops characters that cause problems in Perl word searches $Related_Job_1work=~tr/[a-zA-Z0-9 \.\,\?\@\-]/ /cd; if ($Related_Job_1work eq "select"){ $Related_Job_1work=""; $Related_Job_1="";} $Related_Job_1pass="$Related_Job_1"; #E1. Get the data passed from user $Related_Job_2=$query->param('Related_Job_2'); $Related_Job_2work=lc($Related_Job_2); #E1b. The line below chops characters that cause problems in Perl word searches $Related_Job_2work=~tr/[a-zA-Z0-9 \.\,\?\@\-]/ /cd; if ($Related_Job_2work eq "select"){ $Related_Job_2work=""; $Related_Job_2="";} $Related_Job_2pass="$Related_Job_2"; #E1. Get the data passed from user $Related_Job_3=$query->param('Related_Job_3'); $Related_Job_3work=lc($Related_Job_3); #E1b. The line below chops characters that cause problems in Perl word searches $Related_Job_3work=~tr/[a-zA-Z0-9 \.\,\?\@\-]/ /cd; if ($Related_Job_3work eq "select"){ $Related_Job_3work=""; $Related_Job_3="";} $Related_Job_3pass="$Related_Job_3"; #E1. Get the data passed from user @Featured_Itemarray=$query->param('Featured_Item'); $searchelemcount=@Featured_Itemarray; if ($searchelemcount==1){ @Featured_Itemarray=split(/; /,$Featured_Itemarray[0]);} $Featured_Item=join("\; ",@Featured_Itemarray); $Featured_Item=~s/Select; //g; $Featured_Itemwork=lc($Featured_Item); #E1b. The line below chops characters that cause problems in Perl word searches $Featured_Itemwork=~tr/[a-zA-Z0-9 \.\,\?\@\-]/ /cd; if ($Featured_Itemwork eq "select"){ $Featured_Itemwork=""; $Featured_Item="";} $Featured_Itempass="$Featured_Item"; #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 $Added_By=$query->param('Added_By'); $Added_Bywork=lc($Added_By); #E1b. The line below chops characters that cause problems in Perl word searches $Added_Bywork=~tr/[a-zA-Z0-9 \.\,\?\@\-]/ /cd; if ($Added_Bywork eq "select"){ $Added_Bywork=""; $Added_By="";} $Added_Bypass="$Added_By"; #E1. Get the data passed from user $Date_Added=$query->param('Date_Added'); $Date_Addedwork=lc($Date_Added); #E1b. The line below chops characters that cause problems in Perl word searches $Date_Addedwork=~tr/[a-zA-Z0-9 \.\,\?\@\-]/ /cd; if ($Date_Addedwork eq "select"){ $Date_Addedwork=""; $Date_Added="";} $Date_Addedpass="$Date_Added"; #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. #$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. #$Sub_Categorywork=~tr/[ÈÉÊËéêëè]/e/; #$Sub_Categorywork=~tr/[ÀÁÂÃÄÅÆàáâãäåæ]/a/; #$Sub_Categorywork=~tr/[çÇ]/c/; #$Sub_Categorywork=~tr/[ìíîïÍÎÏÌ]/i/; #$Sub_Categorywork=~tr/[ÒÓÔÕÖòóôõöô]/o/; #$Sub_Categorywork=~tr/[ÙÚÛÜùúûü]/u/; ($Sub_Categoryone, $Sub_Categorytwo, $Sub_Categorythree, $Sub_Categoryfour, $Sub_Categoryfive, $Sub_Categorysix, $Sub_Categoryseven)=split(/ /, $Sub_Categorywork); #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. #$Job_Briefwork=~tr/[ÈÉÊËéêëè]/e/; #$Job_Briefwork=~tr/[ÀÁÂÃÄÅÆàáâãäåæ]/a/; #$Job_Briefwork=~tr/[çÇ]/c/; #$Job_Briefwork=~tr/[ìíîïÍÎÏÌ]/i/; #$Job_Briefwork=~tr/[ÒÓÔÕÖòóôõöô]/o/; #$Job_Briefwork=~tr/[ÙÚÛÜùúûü]/u/; ($Job_Briefone, $Job_Brieftwo, $Job_Briefthree, $Job_Brieffour, $Job_Brieffive, $Job_Briefsix, $Job_Briefseven)=split(/ /, $Job_Briefwork); #F4a. Support for European characters. Uncomment and replace with your #character set in brackets for all non-English Characters. See help files. #$Work_Carried_Outwork=~tr/[ÈÉÊËéêëè]/e/; #$Work_Carried_Outwork=~tr/[ÀÁÂÃÄÅÆàáâãäåæ]/a/; #$Work_Carried_Outwork=~tr/[çÇ]/c/; #$Work_Carried_Outwork=~tr/[ìíîïÍÎÏÌ]/i/; #$Work_Carried_Outwork=~tr/[ÒÓÔÕÖòóôõöô]/o/; #$Work_Carried_Outwork=~tr/[ÙÚÛÜùúûü]/u/; ($Work_Carried_Outone, $Work_Carried_Outtwo, $Work_Carried_Outthree, $Work_Carried_Outfour, $Work_Carried_Outfive, $Work_Carried_Outsix, $Work_Carried_Outseven)=split(/ /, $Work_Carried_Outwork); #F4a. Support for European characters. Uncomment and replace with your #character set in brackets for all non-English Characters. See help files. #$Related_Job_1work=~tr/[ÈÉÊËéêëè]/e/; #$Related_Job_1work=~tr/[ÀÁÂÃÄÅÆàáâãäåæ]/a/; #$Related_Job_1work=~tr/[çÇ]/c/; #$Related_Job_1work=~tr/[ìíîïÍÎÏÌ]/i/; #$Related_Job_1work=~tr/[ÒÓÔÕÖòóôõöô]/o/; #$Related_Job_1work=~tr/[ÙÚÛÜùúûü]/u/; ($Related_Job_1one, $Related_Job_1two, $Related_Job_1three, $Related_Job_1four, $Related_Job_1five, $Related_Job_1six, $Related_Job_1seven)=split(/ /, $Related_Job_1work); #F4a. Support for European characters. Uncomment and replace with your #character set in brackets for all non-English Characters. See help files. #$Related_Job_2work=~tr/[ÈÉÊËéêëè]/e/; #$Related_Job_2work=~tr/[ÀÁÂÃÄÅÆàáâãäåæ]/a/; #$Related_Job_2work=~tr/[çÇ]/c/; #$Related_Job_2work=~tr/[ìíîïÍÎÏÌ]/i/; #$Related_Job_2work=~tr/[ÒÓÔÕÖòóôõöô]/o/; #$Related_Job_2work=~tr/[ÙÚÛÜùúûü]/u/; ($Related_Job_2one, $Related_Job_2two, $Related_Job_2three, $Related_Job_2four, $Related_Job_2five, $Related_Job_2six, $Related_Job_2seven)=split(/ /, $Related_Job_2work); #F4a. Support for European characters. Uncomment and replace with your #character set in brackets for all non-English Characters. See help files. #$Related_Job_3work=~tr/[ÈÉÊËéêëè]/e/; #$Related_Job_3work=~tr/[ÀÁÂÃÄÅÆàáâãäåæ]/a/; #$Related_Job_3work=~tr/[çÇ]/c/; #$Related_Job_3work=~tr/[ìíîïÍÎÏÌ]/i/; #$Related_Job_3work=~tr/[ÒÓÔÕÖòóôõöô]/o/; #$Related_Job_3work=~tr/[ÙÚÛÜùúûü]/u/; ($Related_Job_3one, $Related_Job_3two, $Related_Job_3three, $Related_Job_3four, $Related_Job_3five, $Related_Job_3six, $Related_Job_3seven)=split(/ /, $Related_Job_3work); #F4a. Support for European characters. Uncomment and replace with your #character set in brackets for all non-English Characters. See help files. #$Featured_Itemwork=~tr/[ÈÉÊËéêëè]/e/; #$Featured_Itemwork=~tr/[ÀÁÂÃÄÅÆàáâãäåæ]/a/; #$Featured_Itemwork=~tr/[çÇ]/c/; #$Featured_Itemwork=~tr/[ìíîïÍÎÏÌ]/i/; #$Featured_Itemwork=~tr/[ÒÓÔÕÖòóôõöô]/o/; #$Featured_Itemwork=~tr/[ÙÚÛÜùúûü]/u/; ($Featured_Itemone, $Featured_Itemtwo, $Featured_Itemthree, $Featured_Itemfour, $Featured_Itemfive, $Featured_Itemsix, $Featured_Itemseven)=split(/ /, $Featured_Itemwork); #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. #$Added_Bywork=~tr/[ÈÉÊËéêëè]/e/; #$Added_Bywork=~tr/[ÀÁÂÃÄÅÆàáâãäåæ]/a/; #$Added_Bywork=~tr/[çÇ]/c/; #$Added_Bywork=~tr/[ìíîïÍÎÏÌ]/i/; #$Added_Bywork=~tr/[ÒÓÔÕÖòóôõöô]/o/; #$Added_Bywork=~tr/[ÙÚÛÜùúûü]/u/; ($Added_Byone, $Added_Bytwo, $Added_Bythree, $Added_Byfour, $Added_Byfive, $Added_Bysix, $Added_Byseven)=split(/ /, $Added_Bywork); #F4a. Support for European characters. Uncomment and replace with your #character set in brackets for all non-English Characters. See help files. #$Date_Addedwork=~tr/[ÈÉÊËéêëè]/e/; #$Date_Addedwork=~tr/[ÀÁÂÃÄÅÆàáâãäåæ]/a/; #$Date_Addedwork=~tr/[çÇ]/c/; #$Date_Addedwork=~tr/[ìíîïÍÎÏÌ]/i/; #$Date_Addedwork=~tr/[ÒÓÔÕÖòóôõöô]/o/; #$Date_Addedwork=~tr/[ÙÚÛÜùúûü]/u/; ($Date_Addedone, $Date_Addedtwo, $Date_Addedthree, $Date_Addedfour, $Date_Addedfive, $Date_Addedsix, $Date_Addedseven)=split(/ /, $Date_Addedwork); #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 ($Category){ #print "
  • Category\=$Category\n";} #if ($Sub_Category){ #print "
  • Sub Category\=$Sub_Category\n";} #if ($Title){ #print "
  • Title\=$Title\n";} #if ($Job_Brief){ #print "
  • Job Brief\=$Job_Brief\n";} #if ($Work_Carried_Out){ #print "
  • Work Carried Out\=$Work_Carried_Out\n";} #if ($Related_Job_1){ #print "
  • Related Job 1\=$Related_Job_1\n";} #if ($Related_Job_2){ #print "
  • Related Job 2\=$Related_Job_2\n";} #if ($Related_Job_3){ #print "
  • Related Job 3\=$Related_Job_3\n";} #if ($Featured_Item){ #print "
  • Featured Item\=$Featured_Item\n";} #if ($Rank){ #print "
  • Rank\=$Rank\n";} #if ($Added_By){ #print "
  • Added By\=$Added_By\n";} #if ($Date_Added){ #print "
  • Date Added\=$Date_Added\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/; ($Category,$Sub_Category,$Title,$Image_Upload_1,$Image_Upload_2,$Image_Upload_3,$Image_Upload_4,$Image_Upload_5,$Image_Upload_6,$Job_Brief,$Work_Carried_Out,$Related_Job_1,$Related_Job_2,$Related_Job_3,$Featured_Item,$Rank,$Added_By,$Date_Added,$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$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 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 Sub_Category if (($Sub_Category =~/\b$Sub_Categoryone/ && $Sub_Category =~/\b$Sub_Categorytwo/ && $Sub_Category =~/\b$Sub_Categorythree/ && $Sub_Category =~/\b$Sub_Categoryfour/ && $Sub_Category =~/\b$Sub_Categoryfive/ && $Sub_Category=~/\b$Sub_Categorysix/ && $Sub_Category=~/\b$Sub_Categoryseven/) || !$Sub_Categorywork) { $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 Job_Brief if (($Job_Brief =~/\b$Job_Briefone/ && $Job_Brief =~/\b$Job_Brieftwo/ && $Job_Brief =~/\b$Job_Briefthree/ && $Job_Brief =~/\b$Job_Brieffour/ && $Job_Brief =~/\b$Job_Brieffive/ && $Job_Brief=~/\b$Job_Briefsix/ && $Job_Brief=~/\b$Job_Briefseven/) || !$Job_Briefwork) { $increcount++;} #H12. Look for matches in field named Work_Carried_Out if (($Work_Carried_Out =~/\b$Work_Carried_Outone/ && $Work_Carried_Out =~/\b$Work_Carried_Outtwo/ && $Work_Carried_Out =~/\b$Work_Carried_Outthree/ && $Work_Carried_Out =~/\b$Work_Carried_Outfour/ && $Work_Carried_Out =~/\b$Work_Carried_Outfive/ && $Work_Carried_Out=~/\b$Work_Carried_Outsix/ && $Work_Carried_Out=~/\b$Work_Carried_Outseven/) || !$Work_Carried_Outwork) { $increcount++;} #H12. Look for matches in field named Related_Job_1 if (($Related_Job_1 =~/\b$Related_Job_1one/ && $Related_Job_1 =~/\b$Related_Job_1two/ && $Related_Job_1 =~/\b$Related_Job_1three/ && $Related_Job_1 =~/\b$Related_Job_1four/ && $Related_Job_1 =~/\b$Related_Job_1five/ && $Related_Job_1=~/\b$Related_Job_1six/ && $Related_Job_1=~/\b$Related_Job_1seven/) || !$Related_Job_1work) { $increcount++;} #H12. Look for matches in field named Related_Job_2 if (($Related_Job_2 =~/\b$Related_Job_2one/ && $Related_Job_2 =~/\b$Related_Job_2two/ && $Related_Job_2 =~/\b$Related_Job_2three/ && $Related_Job_2 =~/\b$Related_Job_2four/ && $Related_Job_2 =~/\b$Related_Job_2five/ && $Related_Job_2=~/\b$Related_Job_2six/ && $Related_Job_2=~/\b$Related_Job_2seven/) || !$Related_Job_2work) { $increcount++;} #H12. Look for matches in field named Related_Job_3 if (($Related_Job_3 =~/\b$Related_Job_3one/ && $Related_Job_3 =~/\b$Related_Job_3two/ && $Related_Job_3 =~/\b$Related_Job_3three/ && $Related_Job_3 =~/\b$Related_Job_3four/ && $Related_Job_3 =~/\b$Related_Job_3five/ && $Related_Job_3=~/\b$Related_Job_3six/ && $Related_Job_3=~/\b$Related_Job_3seven/) || !$Related_Job_3work) { $increcount++;} #H11. Look for any word entered in this field if (!$Featured_Itemwork){ $increcount++; }else{ $nomatch=0; foreach $chunk (@Featured_Itemarray){ if ($Featured_Item!~/\b$chunk/i){ $nomatch=1;; }} if (!$nomatch){ $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 Added_By if (($Added_By =~/\b$Added_Byone/ && $Added_By =~/\b$Added_Bytwo/ && $Added_By =~/\b$Added_Bythree/ && $Added_By =~/\b$Added_Byfour/ && $Added_By =~/\b$Added_Byfive/ && $Added_By=~/\b$Added_Bysix/ && $Added_By=~/\b$Added_Byseven/) || !$Added_Bywork) { $increcount++;} #H12. Look for matches in field named Date_Added if (($Date_Added =~/\b$Date_Addedone/ && $Date_Added =~/\b$Date_Addedtwo/ && $Date_Added =~/\b$Date_Addedthree/ && $Date_Added =~/\b$Date_Addedfour/ && $Date_Added =~/\b$Date_Addedfive/ && $Date_Added=~/\b$Date_Addedsix/ && $Date_Added=~/\b$Date_Addedseven/) || !$Date_Addedwork) { $increcount++;} if ($line=~/markedtoedit/ && $actiontotake eq "markedtoedit"){ $line=~s/markedtoedit//g; push (@keepers2,$line);} $line=~s/markedtoedit//g; if ($increcount==12){ push (@keepers,$line);}} #STEP J================================ if ($actiontotake eq "markedtoedit"){ @keepers=@keepers2;} #J1. Sort matches stored in array. @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; if ($length1){ print "$length1 pictures found (displaying $disstart to $enditem). Click here to go back.\n"; } else { print "No pictures are available from this section at the moment, please check back soon.\n";} #STEP K================================ #K1. Do some HTML formatting before showing results 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 "
\n"; #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++; #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,$Category,$Sub_Category,$Title,$Image_Upload_1,$Image_Upload_2,$Image_Upload_3,$Image_Upload_4,$Image_Upload_5,$Image_Upload_6,$Job_Brief,$Work_Carried_Out,$Related_Job_1,$Related_Job_2,$Related_Job_3,$Featured_Item,$Rank,$Added_By,$Date_Added,$skipthisfield)=split (/$delimiter/,$line); # TOOL TIP VERSION HERE # #if ($Image_Upload_1 && $Job_Brief){ #print "$Title','#FFFFFF', 500)\"; onMouseout=\"hideddrivetip()\" src=\"$Imageuploadpath$Image_Upload_1\" width=\"150\" height=\"120\" alt=\"$Title - click for a larger image\" border=\"0\" class=\"picborder\">\n"; # #} else { # #print "$Title','#FFFFFF', 500)\"; onMouseout=\"hideddrivetip()\" src=\"$Imageuploadpath$Image_Upload_1\" width=\"150\" height=\"120\" alt=\"$Title - click for a larger image\" border=\"0\" class=\"picborder\">\n";} # LIGHT BOX VERSION HERE # if ($Image_Upload_1 && $Job_Brief){ print "\"$Title\n"; } else { print "\"$Title\n";} if ($adminpassword eq $checkpassword){ print "
\n";} #K15. Formatting for field Date_Added. If you add any HTML, make sure you #put a backslash in front of all quote marks inside print statements #K11. Check passwords before showing edit and delete buttons #print "
  
\n"; #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"; } #L6. Show problems print "

$problem2\n"; #L7. Show credits. If registered, you can delete entire Step L7 #print "

Search Results by FLATTEXT
\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; ($copyCategory,$copySub_Category,$copyTitle,$copyImage_Upload_1,$copyImage_Upload_2,$copyImage_Upload_3,$copyImage_Upload_4,$copyImage_Upload_5,$copyImage_Upload_6,$copyJob_Brief,$copyWork_Carried_Out,$copyRelated_Job_1,$copyRelated_Job_2,$copyRelated_Job_3,$copyFeatured_Item,$copyRank,$copyAdded_By,$copyDate_Added,$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 ($Category,$Sub_Category,$Title,$Image_Upload_1,$Image_Upload_2,$Image_Upload_3,$Image_Upload_4,$Image_Upload_5,$Image_Upload_6,$Job_Brief,$Work_Carried_Out,$Related_Job_1,$Related_Job_2,$Related_Job_3,$Featured_Item,$Rank,$Added_By,$Date_Added,$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 this Record

\n"; if ($allowimageuploadonedit || $allowtextuploadonedit){ $allowupload="ENCTYPE=\"multipart/form-data\""; $filetext="FILE";} else{ $filetext="TEXT";} 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"; #} # #$showdelete=""; ##if ($Image_Upload_4){ ##$showdelete="
Type Delete above to remove this image, leave completely blank to keep the current image."; ##} # #print "\n"; #if ($Image_Upload_4){ #print "\n"; #} # #$showdelete=""; ##if ($Image_Upload_5){ ##$showdelete="
Type Delete above to remove this image, leave completely blank to keep the current image."; ##} # #print "\n"; #if ($Image_Upload_5){ #print "\n"; #} # #$showdelete=""; ##if ($Image_Upload_6){ ##$showdelete="
Type Delete above to remove this image, leave completely blank to keep the current image."; ##} # #print "\n"; #if ($Image_Upload_6){ #print "\n"; #} $Job_Brief=~s/
/\n/g; $Job_Brief=~s/
/\n/g; print "\n"; #$Work_Carried_Out=~s/
/\n/g; #$Work_Carried_Out=~s/
/\n/g; #print "\n"; #print "\n"; #print "\n"; #print "\n"; #@Featured_Item=split(/\; /,$Featured_Item); #foreach $content (@Featured_Item){ #$content=~tr/[a-zA-Z0-9]//cd; #$checkFeatured_Item{$content}="checked";} #print "\n"; #print "\n"; #print "\n"; print "\n"; #N10. Pass values to next screen print "
Category:
Sub Category:
Title:
Image Upload 1:$showdelete
Image Upload 1
Default Value
$Image_Upload_1 Check here to delete
Image Upload 2:$showdelete
Image Upload 2
Default Value
$Image_Upload_2 Check here to delete
Image Upload 3:$showdelete
Image Upload 3
Default Value
$Image_Upload_3 Check here to delete
Image Upload 4:$showdelete
Image Upload 4
Default Value
$Image_Upload_4 Check here to delete
Image Upload 5:$showdelete
Image Upload 5
Default Value
$Image_Upload_5 Check here to delete
Image Upload 6:$showdelete
Image Upload 6
Default Value
$Image_Upload_6 Check here to delete
Image Description:
Work Carried Out:
Related Job 1:
Related Job 2:
Related Job 3:
Featured Item:\n"; #print " Yes
\n"; #print " No
\n"; #print "
Rank:
Added By:
Date Added:
\n"; print "\n"; print "\n"; print "

\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; ($copyCategory,$copySub_Category,$copyTitle,$copyImage_Upload_1,$copyImage_Upload_2,$copyImage_Upload_3,$copyImage_Upload_4,$copyImage_Upload_5,$copyImage_Upload_6,$copyJob_Brief,$copyWork_Carried_Out,$copyRelated_Job_1,$copyRelated_Job_2,$copyRelated_Job_3,$copyFeatured_Item,$copyRank,$copyAdded_By,$copyDate_Added,$skipthisfield)=split (/$delimiter/,$line); $keepcount++; #O3. Find line to delete if ($keepcount==$linenumberpass){ $linetokeep=$line; $linetokeep=~s/markedtoedit//g; last; } } ($Category,$Sub_Category,$Title,$Image_Upload_1,$Image_Upload_2,$Image_Upload_3,$Image_Upload_4,$Image_Upload_5,$Image_Upload_6,$Job_Brief,$Work_Carried_Out,$Related_Job_1,$Related_Job_2,$Related_Job_3,$Featured_Item,$Rank,$Added_By,$Date_Added,$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 this Record?

\n"; ($Category,$Sub_Category,$Title,$Image_Upload_1,$Image_Upload_2,$Image_Upload_3,$Image_Upload_4,$Image_Upload_5,$Image_Upload_6,$Job_Brief,$Work_Carried_Out,$Related_Job_1,$Related_Job_2,$Related_Job_3,$Featured_Item,$Rank,$Added_By,$Date_Added,$skipthisfield)=split (/$delimiter/,$linetokeep); #O7. Show validation HTML 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"; #if ($deleteonimagerecorddelete=~/y/i && $Image_Upload_4){ #print "\n";} #print "\n"; #if ($deleteonimagerecorddelete=~/y/i && $Image_Upload_5){ #print "\n";} #print "\n"; #if ($deleteonimagerecorddelete=~/y/i && $Image_Upload_6){ #print "\n";} print "\n"; #print "\n"; #print "\n"; #print "\n"; #print "\n"; #print "\n"; #print "\n"; #print "\n"; print "\n"; print "
Category: $Category
Sub_Category: $Sub_Category
Title: $Title
Image_Upload_1: $Image_Upload_1
Image_Upload_2: $Image_Upload_2
Image_Upload_3: $Image_Upload_3
Image_Upload_4: $Image_Upload_4
Image_Upload_5: $Image_Upload_5
Image_Upload_6: $Image_Upload_6
Image Description: $Job_Brief
Work_Carried_Out: $Work_Carried_Out
Related_Job_1: $Related_Job_1
Related_Job_2: $Related_Job_2
Related_Job_3: $Related_Job_3
Featured_Item: $Featured_Item
Rank: $Rank
Added_By: $Added_By
Date_Added: $Date_Added

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

\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");} $Image_Upload_4=$query->param('Image_Upload_4'); if ($Image_Upload_4 && $deleteonimagerecorddelete=~/y/i){ unlink("$Imageuploadpath$Image_Upload_4");} $Image_Upload_5=$query->param('Image_Upload_5'); if ($Image_Upload_5 && $deleteonimagerecorddelete=~/y/i){ unlink("$Imageuploadpath$Image_Upload_5");} $Image_Upload_6=$query->param('Image_Upload_6'); if ($Image_Upload_6 && $deleteonimagerecorddelete=~/y/i){ unlink("$Imageuploadpath$Image_Upload_6");} $replacementline="";} else{ $replacementline="$Category$delimiter$Sub_Category$delimiter$Title$delimiter$Image_Upload_1$delimiter$Image_Upload_2$delimiter$Image_Upload_3$delimiter$Image_Upload_4$delimiter$Image_Upload_5$delimiter$Image_Upload_6$delimiter$Job_Brief$delimiter$Work_Carried_Out$delimiter$Related_Job_1$delimiter$Related_Job_2$delimiter$Related_Job_3$delimiter$Featured_Item$delimiter$Rank$delimiter$Added_By$delimiter$Date_Added";} $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 "Your record has been $recordaction. Please click here to continue.\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="$Category$delimiter$Sub_Category$delimiter$Title$delimiter$Image_Upload_1$delimiter$Image_Upload_2$delimiter$Image_Upload_3$delimiter$Image_Upload_4$delimiter$Image_Upload_5$delimiter$Image_Upload_6$delimiter$Job_Brief$delimiter$Work_Carried_Out$delimiter$Related_Job_1$delimiter$Related_Job_2$delimiter$Related_Job_3$delimiter$Featured_Item$delimiter$Rank$delimiter$Added_By$delimiter$Date_Added"; #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 "Your record has been added. Please click here to continue.\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 $Category=$query->param('Category'); $Sub_Category=$query->param('Sub_Category'); $Title=$query->param('Title'); $Image_Upload_1=$query->param('Image_Upload_1'); $Image_Upload_2=$query->param('Image_Upload_2'); $Image_Upload_3=$query->param('Image_Upload_3'); $Image_Upload_4=$query->param('Image_Upload_4'); $Image_Upload_5=$query->param('Image_Upload_5'); $Image_Upload_6=$query->param('Image_Upload_6'); $Job_Brief=$query->param('Job_Brief'); $Work_Carried_Out=$query->param('Work_Carried_Out'); $Related_Job_1=$query->param('Related_Job_1'); $Related_Job_2=$query->param('Related_Job_2'); $Related_Job_3=$query->param('Related_Job_3'); @Featured_Item=$query->param('Featured_Item'); $Featured_Item=join("\; ",@Featured_Item); $Featured_Item=~s/Select; //g; $Rank=$query->param('Rank'); $Added_By=$query->param('Added_By'); $Date_Added=$query->param('Date_Added'); #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 $Sub_Category=~s/\n/
/g; $Sub_Category=~s/\r//g; if ($Sub_Category eq "Select"){ $Sub_Category="";} #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 $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 $Image_Upload_4=~s/\n/
/g; $Image_Upload_4=~s/\r//g; if ($Image_Upload_4 eq "Select"){ $Image_Upload_4="";} #R3. Replace hard returns with
, cut carriage returns $Image_Upload_5=~s/\n/
/g; $Image_Upload_5=~s/\r//g; if ($Image_Upload_5 eq "Select"){ $Image_Upload_5="";} #R3. Replace hard returns with
, cut carriage returns $Image_Upload_6=~s/\n/
/g; $Image_Upload_6=~s/\r//g; if ($Image_Upload_6 eq "Select"){ $Image_Upload_6="";} #R3. Replace hard returns with
, cut carriage returns $Job_Brief=~s/\n/
/g; $Job_Brief=~s/\r//g; if ($Job_Brief eq "Select"){ $Job_Brief="";} #R3. Replace hard returns with
, cut carriage returns $Work_Carried_Out=~s/\n/
/g; $Work_Carried_Out=~s/\r//g; if ($Work_Carried_Out eq "Select"){ $Work_Carried_Out="";} #R3. Replace hard returns with
, cut carriage returns $Related_Job_1=~s/\n/
/g; $Related_Job_1=~s/\r//g; if ($Related_Job_1 eq "Select"){ $Related_Job_1="";} #R3. Replace hard returns with
, cut carriage returns $Related_Job_2=~s/\n/
/g; $Related_Job_2=~s/\r//g; if ($Related_Job_2 eq "Select"){ $Related_Job_2="";} #R3. Replace hard returns with
, cut carriage returns $Related_Job_3=~s/\n/
/g; $Related_Job_3=~s/\r//g; if ($Related_Job_3 eq "Select"){ $Related_Job_3="";} #R3. Replace hard returns with
, cut carriage returns $Featured_Item=~s/\n/
/g; $Featured_Item=~s/\r//g; if ($Featured_Item eq "Select"){ $Featured_Item="";} #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 $Added_By=~s/\n/
/g; $Added_By=~s/\r//g; if ($Added_By eq "Select"){ $Added_By="";} #R3. Replace hard returns with
, cut carriage returns $Date_Added=~s/\n/
/g; $Date_Added=~s/\r//g; if ($Date_Added eq "Select"){ $Date_Added="";} #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*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_2,$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_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');} #New routines added 6/29/06 to support Firefox and Mac file name upload formats $checkcontent=0; ($fn,$et)=split(/./,$Image_Upload_4); $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_4=~/\\/ || $Image_Upload_4=~/\:/ || $checkcontent) && $Image_Upload_4 !~/delete/i){ $containsimageImage_Upload_4=1; #Get Unix time. Will constitute file name if (!$tstamp){ $tstamp=time;} else{ $tstamp++;} @splitparts=split(/\./,$Image_Upload_4); $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_4=~/\.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_4,$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_4checksize=-s "$Imageuploadpath$tstamp.$extension"; if ($Image_Upload_4checksize<5){ $problem="Unable to upload the image in field $Image_Upload_4. 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_4="$tstamp.$extension"; } $Image_Upload_4delete=$query->param('Image_Upload_4b'); if (!$Image_Upload_4 && $Image_Upload_4delete){ unlink("$Imageuploadpath$Image_Upload_4delete"); } elsif (!$containsimageImage_Upload_4 && $actiontotake=~/edit/i){ $Image_Upload_4=$query->param('Image_Upload_4bb');} #New routines added 6/29/06 to support Firefox and Mac file name upload formats $checkcontent=0; ($fn,$et)=split(/./,$Image_Upload_5); $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_5=~/\\/ || $Image_Upload_5=~/\:/ || $checkcontent) && $Image_Upload_5 !~/delete/i){ $containsimageImage_Upload_5=1; #Get Unix time. Will constitute file name if (!$tstamp){ $tstamp=time;} else{ $tstamp++;} @splitparts=split(/\./,$Image_Upload_5); $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_5=~/\.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_5,$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_5checksize=-s "$Imageuploadpath$tstamp.$extension"; if ($Image_Upload_5checksize<5){ $problem="Unable to upload the image in field $Image_Upload_5. 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_5="$tstamp.$extension"; } $Image_Upload_5delete=$query->param('Image_Upload_5b'); if (!$Image_Upload_5 && $Image_Upload_5delete){ unlink("$Imageuploadpath$Image_Upload_5delete"); } elsif (!$containsimageImage_Upload_5 && $actiontotake=~/edit/i){ $Image_Upload_5=$query->param('Image_Upload_5bb');} #New routines added 6/29/06 to support Firefox and Mac file name upload formats $checkcontent=0; ($fn,$et)=split(/./,$Image_Upload_6); $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_6=~/\\/ || $Image_Upload_6=~/\:/ || $checkcontent) && $Image_Upload_6 !~/delete/i){ $containsimageImage_Upload_6=1; #Get Unix time. Will constitute file name if (!$tstamp){ $tstamp=time;} else{ $tstamp++;} @splitparts=split(/\./,$Image_Upload_6); $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_6=~/\.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_6,$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_6checksize=-s "$Imageuploadpath$tstamp.$extension"; if ($Image_Upload_6checksize<5){ $problem="Unable to upload the image in field $Image_Upload_6. 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_6="$tstamp.$extension"; } $Image_Upload_6delete=$query->param('Image_Upload_6b'); if (!$Image_Upload_6 && $Image_Upload_6delete){ unlink("$Imageuploadpath$Image_Upload_6delete"); } elsif (!$containsimageImage_Upload_6 && $actiontotake=~/edit/i){ $Image_Upload_6=$query->param('Image_Upload_6bb');} if ($actiontotake!~/edit/i || !$Date_Added){ #Formatting for Unix Date Added Stamp ($secstamp,$minstamp,$hourstamp,$mdaystamp,$monthstamp,$yearstamp,$wdaystamp,$dayofyearstamp,$isdst1stamp) = localtime(time); $monthstamp++; $yearstamp=1900+$yearstamp; if (length($monthstamp)==1){ $monthstamp="0$monthstamp";} if (length($mdaystamp)==1){ $mdaystamp="0$mdaystamp";} $Date_Added="$yearstamp/$monthstamp/$mdaystamp";} } #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(\+\+)$Category$delimiter$Sub_Category$delimiter$Title$delimiter$Image_Upload_1$delimiter$Image_Upload_2$delimiter$Image_Upload_3$delimiter$Image_Upload_4$delimiter$Image_Upload_5$delimiter$Image_Upload_6$delimiter$Job_Brief$delimiter$Work_Carried_Out$delimiter$Related_Job_1$delimiter$Related_Job_2$delimiter$Related_Job_3$delimiter$Featured_Item$delimiter$Rank$delimiter$Added_By$delimiter$Date_Added"; #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 "KEY
A=Add to Database
D=Delete from Temp File
E=Add to Database but Mark for Editing
H=Hold in Temp File for Decision Later

\n"; print "\n"; print "\n"; foreach $line (@all){ $line=~s/\n//g; $checkleng=length($line); if ($checkleng<2){next}; ($indexvalues,$stringvalues)=split(/\(\+\+\)/,$line); ($ipaddress,$uniqueapproval)=split(/&&/,$indexvalues); ($Category,$Sub_Category,$Title,$Image_Upload_1,$Image_Upload_2,$Image_Upload_3,$Image_Upload_4,$Image_Upload_5,$Image_Upload_6,$Job_Brief,$Work_Carried_Out,$Related_Job_1,$Related_Job_2,$Related_Job_3,$Featured_Item,$Rank,$Added_By,$Date_Added,$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"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; $keeptrack2++; if ($keeptrack2>10){ last}; } print "
ADEHFieldContents
IP Address:$ipaddress
    Category:$Category
    Sub Category:$Sub_Category
    Title:$Title
    Image Upload 1:$Image_Upload_1
    Image Upload 2:$Image_Upload_2
    Image Upload 3:$Image_Upload_3
    Image Upload 4:$Image_Upload_4
    Image Upload 5:$Image_Upload_5
    Image Upload 6:$Image_Upload_6
    Job Brief:$Job_Brief
    Work Carried Out:$Work_Carried_Out
    Related Job 1:$Related_Job_1
    Related Job 2:$Related_Job_2
    Related Job 3:$Related_Job_3
    Featured Item:$Featured_Item
    Rank:$Rank
    Added By:$Added_By
    Date Added:$Date_Added
\n"; if ($keeptrack2>=10){ print "

\n";} else{ print "\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); ($Category,$Sub_Category,$Title,$Image_Upload_1,$Image_Upload_2,$Image_Upload_3,$Image_Upload_4,$Image_Upload_5,$Image_Upload_6,$Job_Brief,$Work_Carried_Out,$Related_Job_1,$Related_Job_2,$Related_Job_3,$Featured_Item,$Rank,$Added_By,$Date_Added,$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