# This file works in conjunction with parse_datafile.php. # in Tandem they create Versaverter Online - with this page as the wrapper and # with parse_datafile.php doing the actual work # # # Copyright 2000 PawPrint.net # By Scott Baker # All Rights Reserved # # # Version 1.0.0 # Last Modified Nov. 14 2000 include('../../include/pageinfo.inc.php'); include('../../include/constants.inc.php'); include('../../include/helpers.inc.php'); include('../../include/db.inc.php'); include('../../include/dbfunctions.inc.php'); $PageInfo->Section = 'vv'; $PageInfo->Title ='Versaverter Online - convert your thinking on the web!'; $PageInfo->PrimeKeywords = 'units,measurment,length,width,volume,time,speed,acceleration,velocity,telecommunications,metric,SI,bredth,weight,mass'; $PageInfo->Description = 'Versaverter is one of the mot popular Windows unit conversion applications - try the online version for free.'; $pTitle="Versaverter Online"; $pSidebar="VV"; include("../../include/header.inc.php"); //Configure Default values for all conversion parameters if (!isset($pClass)) { $pClass = "Length";} if (!isset($pToCtype)) { $pToCtype = "ctFactor";} if (!isset($pUFrom)) { $pUFrom = "ctFactor 1 x"; } else { $vFromItems = split( '\^', $pUFrom, 5); $pFromName = $vFromItems[0]; $pFromSymbol = $vFromItems[1]; $pUFrom = $vFromItems[2] . " " . $vFromItems[3] . " " . $vFromItems[4]; } if (!isset($pUTo)) { $pUTo = "ctFactor 1 x"; } else { $vToItems = split( '\^', $pUTo, 5); $pToName = $vToItems[0]; $pToSymbol = $vToItems[1]; $pUTo = $vToItems[2] . " " . $vToItems[3] . " " . $vToItems[4]; } if (!isset($pConvertValue)) {$pConvertValue = 1;} //Setup path to units.txt datafile $vDataFile = $cBasePath.$cVVUpdatePath."/units.txt"; ?>
if ($pGoConvert) { //A Conversion was requested //Create the actual conversion command $vCMD = $cBasePath . "/cgibin/vv/vvNet.pl " . "$pUFrom $pUTo $pConvertValue"; //echo($vCMD); //Execute the conversion $vCmdOutput = exec($vCMD, $vCmdOutputLines, $vResult); //Print command here to beta test //echo($vCMD); //Deal with the Errors or results if ($vResult != '0') { //An Error Occured ?>
Error during conversion:
Return Code:
while (list($key, $vCmdOutput) = each ($vCmdOutputLines)) {
echo "$vCmdOutput
";
}
}
else {
?>
} include("../../include/pagesplit.inc.php"); }//End if a conversion was requested //Parse the Units.txt datafile and output the selection area. include("parse_datafile.php"); //Finish off the page include("../../include/footer.inc.php"); ?>