Advertisement
Guest User

collator5

a guest
Mar 31st, 2014
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 19.58 KB | None | 0 0
  1. <?php
  2. header('Content-Type: text/html; charset=UTF-8');
  3. header('Access-Control-Allow-Origin: *');
  4. /**
  5.  * Project:     Collator: the Question Writer results collator
  6.  * File:        qwhtml5.php
  7.  *
  8.  * Copyright 2008-2013 Question Writer Corporation
  9.  *
  10.  * This application is provided as an extension of the
  11.  * Question Writer desktop software. Where you hold a valid, paid-for
  12.  * license for the Question Writer desktop software, you are hereby
  13.  * granted a license to use and modify this application for personal use
  14.  * and use internal to your organization. All other rights are reserved.
  15.  *
  16.  * This application is distributed in the hope that it will be useful,
  17.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  19.  *
  20.  * @link http://www.questionwriter.com/
  21.  * @copyright 2008-2013 Question Writer Corporation
  22.  * @author Alexander McCabe
  23.  * @package Collator
  24.  * @version 5.0.2
  25.  *
  26.  * 5.0.2
  27.  * Use Source ID in preference to Candidate entry where present
  28.  *
  29.  * 5.0.1
  30.  * Added Browser info to email for debugging
  31.  *
  32.  * 5
  33.  * Changed XML parsing to modern library
  34.  * Added content type and origin headers to allow XML post requests from HTML file
  35.  *
  36.  * 1.4.1
  37.  * Added support for the order attribute added to item_result in QW4.1
  38.  *
  39.  * 1.4
  40.  * Added support for Plugin Question types
  41.  * Added support for Multiple Questions per page
  42.  *
  43.  * 1.3
  44.  * Changed Error Logging to remove uninteresting errors
  45.  *
  46.  * 1.2
  47.  * Added additional identifiers to the email where they are not blank
  48.  * Added change IP recorded when resultset comes from backup server
  49.  * Added additional Candidate fields written into userdata db fields
  50.  * Added fix to XML parsing to allow for special XML characters in ID, also remove spaces after special XML characters
  51.  * Added facility to check if e-mail is not provided directly, but referenced by an id
  52.  *
  53.  * 1.1.1
  54.  * Put all the Resultsets into a single SQL query to reduce processing time
  55.  * Added ReplyTo header to help with spam rating
  56.  * Added MIME header for e-mail to avoid MIME_HEADER_CTYPE_ONLY rating
  57.  * Added newline in table for each line - email was being rejected for having lines that were too long
  58.  * Externalized e-mail call
  59.  * Added duplicate result checking in LogXML function
  60.  * Set LogXML to false as a default
  61.  * Check PassFail value for PASS/FAIL value - set to pass if value not recognized
  62.  * Check for empty name/value pairs generated by old QW quizzes
  63.  *
  64.  * 1.1.0
  65.  * Added all questiondata to a single SQL statement
  66.  * Added codedpreferences.inc.php to allow code to check whether to store results in database and send email
  67.  * Time field now entered properly in QuestionData table after 'PS' characters trimmed
  68.  * Removed spaces at start and end of PHP files which may have caused problems returning 500 errors
  69.  * Added Total Time Field to database and filled it by summing time taken for questions
  70.  * Added error returns where MySQL statements fail
  71.  * Added Email functionality
  72.  * Changed all table names to lower-case
  73.  * Added logging of result set XML to files capability
  74.  * Remove printing trivial XML document 'ok' from response
  75.  * Formatted Quiz and Question title to remove extraneous numbers and ids
  76.  * Modified total time to display in Hours, Minutes, Seconds
  77.  *
  78.  * 1.0.0
  79.  * Initial Release
  80.  */
  81.  
  82.     //Include the files this script depends upon
  83.     include "config.php";
  84.     include "include/processqwhtml5xml.inc.php";
  85.     include "include/functions.inc.php";
  86.     include "include/codedpreferences.inc.php";
  87.     //include "include/parse_xml.inc.php";
  88.    
  89.  
  90.     //Get the IP address of the result set sender
  91.     $ipvar=$_SERVER['REMOTE_ADDR'];
  92.    
  93.     //Trim the e-mail to ignore leading and trailing whitespace.
  94.     $emailID=trim($_GET['e']);
  95.    
  96.     //Ensure that the e-mail is a real email address.
  97.     //This also returns an error if there are any disallowed characters in the email address
  98.     if(!isValidEmail($emailID))
  99.     {
  100.         //error_log($_GET['id']);
  101.         //Check if the user has been reference by ID instead
  102.         $userid=trim($_GET['id']);
  103.        
  104.         if($emailID=getEmailFromUserID($userid,$dbhost,$dbusername,$dbuserpass,$db_name)){
  105.             //Fine
  106.         }else{
  107.             //Otherwise return an error to the client      
  108.             returnError("Invalid E-mail Address. EmailID:".trim($_GET['e'])." UserID:".trim($_GET['id']));
  109.         }
  110.        
  111.     }
  112.    
  113.     //Set the timestamp
  114.     $newTime=time();
  115.    
  116.     //Check if this is from the backup server in which case we use the timestamp of the backup server
  117.     //We only accept the communicated timestamp if we confirm the IP is that of the backup server  
  118.     if(isset($_GET['newtime']) && ($ipvar==$backupServerIP || $ipvar==$backupServerIPAlt))
  119.     {
  120.         $newTime=(int)$_GET['newtime'];
  121.         $ipvar=$_GET['originalip'];
  122.     }
  123.        
  124.     $HTTP_RAW_POST_DATA="";
  125.     $newdatafile="";
  126.    
  127.    
  128.     //Setup an array to store the question data
  129.     $respIDs=array();
  130.     //Set up an array to store the Resultset data
  131.     $contextData=array();
  132.     //Set up an array to store custom scores
  133.     $customScores=array();
  134.    
  135.     //Check there is a valid XML file in the POST request
  136.     if($xml = getPostedXML())
  137.     {      
  138.         $data=$xml;
  139.         //error_log($data);
  140.         $newdatafile=$data;
  141.         $validDoc=processResultXML($data,$emailID);
  142.  
  143.  
  144.         if (!$validDoc)
  145.         {
  146.             // If XML is not valid, return error
  147.             //$reason = xml_error_string(xml_get_error_code($xmlparser));
  148.             //$reason .= xml_get_current_line_number($xmlparser);
  149.             returnError("Error parsing posted XML - Invalid Document");
  150.         }
  151.     }
  152.     else
  153.     {
  154.     returnError("No XML Document");    
  155.        
  156.       //If XML is not found, return error, but don't log
  157.       //returnErrorNoLog();
  158.       //returnError("Error - did not find suitable XML " . $xml);    
  159.     }
  160.    
  161.     $XMLFileLog="";
  162.     $XMLProcessedFileLog="";
  163.     if(logXML()){
  164.        
  165.         //Check directory exists for day in question
  166.         $XMLLogDirectory=$archivelogdirectory."/".date("Ymd",$newTime);
  167.         if(!is_dir($XMLLogDirectory)){
  168.             mkdir($XMLLogDirectory);
  169.             chmod($XMLLogDirectory, 0757);
  170.         }
  171.        
  172.         $md5hash=md5($newdatafile);
  173.        
  174.         //Write XML to directory
  175.         $XMLFileLog=$XMLLogDirectory."/".$ipvar."-".$md5hash."-".$emailID.".xml";
  176.         $XMLProcessedFileLog=$XMLLogDirectory."/".$ipvar."-".$md5hash."-".$emailID.".processed.xml";
  177.        
  178.         //Check for duplicates - exit with a processed code if this file has already been received.
  179.         if(file_exists($XMLProcessedFileLog)){
  180.             header('Content-Type: text/xml; Charset: utf-8');
  181.             print("<OK/>");
  182.             exit();
  183.         }
  184.        
  185.         if($handle1=fopen($XMLFileLog, "w")){
  186.             if (fwrite($handle1, $newdatafile)){
  187.                 if(!fclose($handle1)){
  188.                     returnError("Error - could not close log file - "+$XMLFileLog);
  189.                 }
  190.             }else
  191.             {
  192.                 returnError("Error - could not write XML to log file"+$XMLFileLog);
  193.             }
  194.         }else{
  195.             returnError("Error - could not open file for writing - "+$XMLFileLog);
  196.         }
  197.     }
  198.    
  199.  
  200.     //Check pass/fail value is PASS or FAIL
  201.     if($contextData["passfail"]!='PASS' && $contextData["passfail"]!='FAIL'){
  202.         $contextData["passfail"]='PASS';
  203.     }
  204.  
  205.     //Make responses human readable
  206.     foreach ($respIDs as $key => $value){
  207.             if ($key=="RandomChooser" || startsWith($key,"Candidate")){
  208.                 continue;
  209.             }
  210.  
  211.             $responseText="";
  212.  
  213.  
  214.             switch ($value["Type"]){
  215.                 case "MultipleChoice":
  216.                 case "MultipleResponse":
  217.                 case "PartialCredit":
  218.                 case "Sequencing":
  219.                     $responseKeys=preg_split("/,/",$value["Response"]);
  220.                     foreach($responseKeys as $rk){
  221.                         $responseText=$responseText.tokenTruncate($value["summarydata"][$rk],60).", ";
  222.                     }
  223.                     $responseText=trim($responseText," ");
  224.                     $responseText=trim($responseText,",");
  225.                     break;
  226.                 case "Matching":
  227.                     $responseKeys=preg_split("/,/",$value["Response"]);
  228.                     $bracketcount=0;
  229.                     foreach($responseKeys as $rk){
  230.                         if($bracketcount%2==0){
  231.                             $responseText.="(";
  232.                         }else{
  233.                             $responseText.=":";
  234.                         }
  235.  
  236.                         $responseText=$responseText.tokenTruncate($value["summarydata"][$rk],60);
  237.                         if($bracketcount%2==1){
  238.                             $responseText.="), ";
  239.                         }
  240.                         $bracketcount++;
  241.                     }
  242.                     $responseText=trim($responseText," ");
  243.                     $responseText=trim($responseText,",");
  244.                     break;
  245.                 case "FillInTheBlank":
  246.                 case "Essay":
  247.                 case "Plugin":
  248.                     $responseText=$value["Response"];
  249.                     break;
  250.                 default: //This covers Plugin questions with the plugin type specified
  251.                     $responseText=$value["Response"];
  252.                     break;
  253.             }
  254.             $respIDs[$key]["ResponseSummary"]=$responseText;
  255.     }
  256.  
  257.     /*
  258.  
  259.     //Sort according to order in column 6 so if XML order has changed somehow, results will still be returned in the correct order.
  260.     //Works only for quizzes created with QW 44.1.4123.37396+
  261.     if($Aanswers[0][6]!=null || $Aanswers[1][6]!=null || $Aanswers[2][6]!=null){
  262.                 //Looking for a recorded order attribute here - should be one in the first three entries at least.
  263.         $ordering = array();
  264.         foreach ($Aanswers as $key => $row) {
  265.             $ordering[$key]  = $row[6];
  266.         }
  267.         array_multisort($ordering, SORT_ASC, $Aanswers);
  268.     }
  269.  
  270.     //Add User Configured Scores
  271.     foreach ($UserDefinedScores as $k => $v) {
  272.         if($UserDefinedScoresCount[$k]>1 && $k!="score"){
  273.             $Aanswers[$answerseq][5]="User Defined Score: " . $k;
  274.             $Aanswers[$answerseq][1]="User Defined Score: " . $k;
  275.             $Aanswers[$answerseq][3]=$UserDefinedScores[$k];
  276.             $answerseq++;  
  277.         }
  278.     }
  279.     */
  280.  
  281. //Some tests are returning these as empty - they cannot be empty
  282. if($contextData["TotalTime"]==""){$contextData["TotalTime"]="0";}
  283. if($contextData["overallscore"]==""){$contextData["overallscore"]="0";}
  284. if($contextData["totalpossiblescore"]==""){$contextData["totalpossiblescore"]="0";}
  285. if($contextData["percentagescore"]==""){$contextData["percentagescore"]="0";}
  286. if($contextData["percentagepass"]==""){$contextData["percentagepass"]="0";}
  287.  
  288.     //Check if the user has requested not to store info in the database
  289.     if(storeResultsInDatabase($emailID,$dbhost,$dbusername,$dbuserpass,$db_name)){
  290.                
  291.         //Open the database connection
  292.         mysql_connect($dbhost,$dbusername,$dbuserpass) or returnError("Error - could not connect to database");
  293.        
  294.         //Choose the database
  295.         @mysql_select_db($db_name) or returnError("Error - unable to select database");
  296.        
  297.         //Begin the transaction - we'll only write to the database if we successfully write all the questions to the database too
  298.         mysql_query("BEGIN") or returnError("Error - unable to begin database transaction");
  299.        
  300.        
  301.         //QuizName,TotalTime,
  302.        
  303.         //Insert Resultset
  304.         $query="INSERT INTO resultsets (Email,Candidate,QuizName,TotalTime,OverAllScore,TotalPossibleScore,PercentageScore,PercentageScoreString,PercentagePass,PassFail,TimeStamp,SystemLanguage,OS,ScreenRes,Version,ClientTime,SourceURL,Data1,Data2,Data3,Data4,Data5,UserIP,html5) VALUES ";
  305.         $query .= "(";
  306.         $query .= "\"".mysql_real_escape_string($emailID)."\",";
  307.         $query .= "\"".mysql_real_escape_string($contextData["Source ID"]==""?$respIDs["Candidate"]["Response"]:$contextData["Source ID"])."\",";
  308.         $query .= "\"".mysql_real_escape_string($contextData["Quiz Title"])."\",";
  309.         $query .= mysql_real_escape_string($contextData["TotalTime"]).",";
  310.         $query .= mysql_real_escape_string($contextData["overallscore"]).",";
  311.         $query .= mysql_real_escape_string($contextData["totalpossiblescore"]).",";
  312.         $query .= mysql_real_escape_string($contextData["percentagescore"]).",";
  313.         $query .= "\"".mysql_real_escape_string($contextData["percentagescorestring"])."\",";
  314.         $query .= mysql_real_escape_string($contextData["percentagepass"]).",";
  315.         $query .= "\"".mysql_real_escape_string($contextData["passfail"])."\",";
  316.         $query .= "".mysql_real_escape_string($newTime).",";
  317.         $query .= "\"".mysql_real_escape_string($contextData["System Language"])."\",";
  318.         $query .= "\"".mysql_real_escape_string($contextData["OS"])."\",";
  319.         $query .= "\"".mysql_real_escape_string($contextData["Screen Res"])."\",";
  320.         $query .= "\"".mysql_real_escape_string($contextData["Version"])."\",";
  321.         $query .= "\"".mysql_real_escape_string($contextData["Client Time"])."\",";
  322.         $query .= "\"".mysql_real_escape_string($contextData["Source URL"])."\",";
  323.         $query .= "\"".mysql_real_escape_string($respIDs["Candidate"]["Response"])."\",";
  324.         $query .= "\"".mysql_real_escape_string($respIDs["CandidateData2"]["Response"])."\",";
  325.         $query .= "\"".mysql_real_escape_string($respIDs["CandidateData3"]["Response"])."\",";
  326.         $query .= "\"".mysql_real_escape_string($respIDs["CandidateData4"]["Response"])."\",";
  327.         $query .= "\"".mysql_real_escape_string($respIDs["CandidateData5"]["Response"])."\",";
  328.         $query .= "\"".mysql_real_escape_string($ipvar)."\",";
  329.         $query .= "1";
  330.         $query .= "); ";
  331.         //error_log($query);
  332.         mysql_query($query) or returnError("Error - 1. unable to write result set data ".$ipvar." ".mysql_error());
  333.         //Get the updated ID of the resultset
  334.         $resultid=mysql_insert_id();
  335.        
  336.        
  337.         $query="";
  338.         foreach ($customScores as $key => $value){
  339.             $query .= "(";
  340.             $query .= mysql_real_escape_string($resultid).",";
  341.             $query .= "\"".mysql_real_escape_string($key)."\",";
  342.             $query .= mysql_real_escape_string($value);
  343.             $query .= "),";
  344.         }  
  345.  
  346.         $query=trim($query,",");
  347.         if($query!=""){
  348.             $query = "INSERT INTO qw5customscores (ResultSetID,Varname,Score) VALUES ".$query;     
  349.             mysql_query($query) or returnError("Error 2 - unable to write result set data ".mysql_error());
  350.         }
  351.  
  352.         $query1="";
  353.         $query2="";
  354.  
  355.         foreach ($respIDs as $key => $value){
  356.            
  357.             if ($key=="RandomChooser" || startsWith($key,"Candidate")){
  358.                 continue;
  359.             }
  360.  
  361.             if(!isset($value["Score"])){
  362.                 continue;
  363.             }
  364.             if(!is_numeric($value["Score"])){
  365.                 $value["Score"]=-1;
  366.             }          
  367.  
  368.             $query1 .= "(";
  369.             $query1 .= "\"".mysql_real_escape_string($emailID)."\",";
  370.             $query1 .= "\"".mysql_real_escape_string($value["MD5hash"])."\",";
  371.             $query1 .= "\"".mysql_real_escape_string($key)."\",";
  372.             $query1 .= "\"".mysql_real_escape_string($value["xmlsummary"])."\"";
  373.             $query1 .= "),";
  374.                                    
  375.             $query2 .= "(";
  376.             $query2 .= "".mysql_real_escape_string($resultid).",";
  377.             $query2 .= "\"".mysql_real_escape_string($value["MD5hash"])."\",";
  378.             $query2 .= "\"".mysql_real_escape_string($key)."\",";
  379.             $query2 .= "\"".mysql_real_escape_string($value["Response"])."\",";
  380.             $query2 .= "\"".mysql_real_escape_string($value["LongResponse"])."\",";
  381.             $query2 .= "".mysql_real_escape_string($value["Score"]).",";
  382.             $query2 .= "".mysql_real_escape_string($value["QuestionTime"]).",";
  383.             $query2 .= "\"".mysql_real_escape_string($value["ResponseSummary"])."\"";
  384.             $query2 .= "),";
  385.         }  
  386.         $query1=trim($query1,",");
  387.         $query2=trim($query2,",");
  388.  
  389.        
  390.         if($query1!=""){
  391.             $query1 = "INSERT IGNORE INTO qw5questionsref (Email,MD5hash,QuestionReference,xmlsummary) VALUES ".$query1;       
  392.             mysql_query($query1) or returnError("Error 4 - unable to write result set data ".$query1." ".mysql_error());
  393.         }
  394.         if($query2!=""){
  395.             $query2 = "INSERT INTO qw5questiondata (ResultSetID,MD5hash,QuestionReference,Response,LongResponse,Score,QuestionTime,ResponseSummary) VALUES ".$query2;
  396.             mysql_query($query2) or returnError("Error 5 - unable to write result set data ".$query2." ".mysql_error());
  397.         }
  398.                
  399.         //Commit the transaction, writing to the database and closing the connection
  400.         mysql_query("COMMIT");
  401.         //mysql_close();
  402.     }  
  403.  
  404.    
  405.     //Check if the user has requested email
  406.     if(sendResultsByEmail($emailID,$dbhost,$dbusername,$dbuserpass,$db_name)){
  407.         //Main Email Body
  408.         $mailclient="";
  409.         $mailclient.="<h1>".htmlspecialchars(formatQuizTitle($contextData["Quiz Title"]))."</h1>". "\r\n";
  410.         $mailclient.="<h2>Summary</h2>". "\r\n";
  411.         $mailclient.="<table border=\"0\" cellspacing=\"0\" cellpadding=\"4\">". "\r\n";
  412.         $mailclient.="  <tr><th align=\"right\">Name or User ID: </th><td>".htmlspecialchars($contextData["Source ID"]==""?$respIDs["Candidate"]["Response"]:$contextData["Source ID"])."</td></tr>". "\r\n";
  413.        
  414.         if(strlen($respIDs["CandidateData2"]["Response"])>0){
  415.             $mailclient.="  <tr><th align=\"right\">Second Identifier: </th><td>".htmlspecialchars($respIDs["CandidateData2"]["Response"])."</td></tr>". "\r\n";
  416.         }
  417.         if(strlen($respIDs["CandidateData3"]["Response"])>0){
  418.             $mailclient.="  <tr><th align=\"right\">Third Identifier: </th><td>".htmlspecialchars($respIDs["CandidateData3"]["Response"])."</td></tr>". "\r\n";
  419.         }
  420.         if(strlen($respIDs["CandidateData4"]["Response"])>0){
  421.             $mailclient.="  <tr><th align=\"right\">Fourth Identifier: </th><td>".htmlspecialchars($respIDs["CandidateData4"]["Response"])."</td></tr>". "\r\n";
  422.         }
  423.         if(strlen($respIDs["CandidateData5"]["Response"])>0){
  424.             $mailclient.="  <tr><th align=\"right\">Fifth Identifier: </th><td>".htmlspecialchars($respIDs["CandidateData5"]["Response"])."</td></tr>". "\r\n";
  425.         }
  426.        
  427.  
  428.        
  429.         $mailclient.="  <tr><th align=\"right\">Overall Score: </th><td>".htmlspecialchars($contextData["overallscore"])."</td></tr>". "\r\n";
  430.         $mailclient.="  <tr><th align=\"right\">Total Possible Score: </th><td>".htmlspecialchars($contextData["totalpossiblescore"])."</td></tr>". "\r\n";
  431.         $mailclient.="  <tr><th align=\"right\">Percentage Score: </th><td>".htmlspecialchars($contextData["percentagescore"])."</td></tr>". "\r\n";
  432.         $mailclient.="  <tr><th align=\"right\">Percentage Score String: </th><td>".htmlspecialchars($contextData["percentagescorestring"])."</td></tr>". "\r\n";
  433.         $mailclient.="  <tr><th align=\"right\">Percentage Pass: </th><td>".htmlspecialchars($contextData["percentagepass"])."</td></tr>". "\r\n";
  434.         $mailclient.="  <tr><th align=\"right\">Pass/Fail: </th><td>".htmlspecialchars($contextData["passfail"])."</td></tr>". "\r\n";
  435.         $mailclient.="  <tr><th align=\"right\">Timestamp: </th><td>".htmlspecialchars(date("D, M j, G:i:s T Y",$newTime))."</td></tr>". "\r\n";
  436.         $mailclient.="  <tr><th align=\"right\">Time Spent: </th><td>".htmlspecialchars(formatseconds(number_format($contextData["TotalTime"],2,'.','')))."</td></tr>". "\r\n";
  437.        
  438.         foreach ($customScores as $key => $value){
  439.             $mailclient.="  <tr><th align=\"right\">Custom Score(".htmlspecialchars($key)."): </th><td>".htmlspecialchars($value)."</td></tr>". "\r\n";
  440.         }
  441.        
  442.         $mailclient.="</table><h2>Questions</h2>". "\r\n";
  443.         $mailclient.="<table border=\"0\" cellspacing=\"0\" cellpadding=\"4\">". "\r\n";
  444.         $mailclient.="<tr><th>Question</th><th>Score</th><th>Duration</th><th></th><th>Answer</th></tr>". "\r\n";
  445.        
  446.         foreach ($respIDs as $key => $value){
  447.             if ($key=="RandomChooser" || startsWith($key,"Candidate")){
  448.                 continue;
  449.             }
  450.            
  451.             $mailclient.="<tr><td>".htmlspecialchars(formatQuestionTitle($key))."</td><td align=\"right\">".htmlspecialchars($value["Score"])."</td><td align=\"right\">".htmlspecialchars(number_format($value["QuestionTime"],2,'.',''))."s</td><td>&nbsp;</td><td>".nl2br(htmlspecialchars($value["LongResponse"].$value["ResponseSummary"]))."</td></tr>\r\n";
  452.         }
  453.         $mailclient.="</table>". "\r\n";
  454.         $mailclient.="<br/>Browser Info: ".htmlspecialchars($contextData["OS"]." ".$contextData["Screen Res"]." ".$contextData["Version"])."\r\n";     
  455.         $mailclient.="<br/>Quiz responses sent ".htmlspecialchars(date("D, M j, G:i:s T Y",$newTime))." from IP ".htmlspecialchars($ipvar). "<br/><br/>".getMessage()."\r\n";
  456.        
  457.            
  458.         $subject="Quiz Results ".htmlspecialchars($contextData["Source ID"]==""?$respIDs["Candidate"]["Response"]:$contextData["Source ID"])."- ".htmlspecialchars($contextData["overallscore"])." (".htmlspecialchars($contextData["percentagescore"])."%)";
  459.        
  460.         sendEmail($emailID, $subject, $mailclient, $from, $fromemail,$dbhost,$dbusername,$dbuserpass,$db_name);
  461.         //error_log($mailclient);
  462.     }
  463.    
  464.    
  465.     //Rename the log file to indicate that it has been processed.
  466.     //This is help prevent duplicate requests being reprocessed.
  467.     if(logXML() && file_exists($XMLFileLog) && !file_exists($XMLProcessedFileLog)){
  468.         rename($XMLFileLog,$XMLProcessedFileLog);
  469.     }
  470.  
  471.        
  472.     print("<OK/>");
  473.     //End of script
  474.    
  475.    
  476.    
  477. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement