'; if($inParent) echo 'window.parent.location.href="'.$url.'";'; else echo 'window.location.href="'.$url.'";'; echo ''; echo ''; } } // Filters unwanted characters out of an input string. Useful for tidying up FORM field inputs function cleanInput($strRawText,$strType) { if ($strType=="Number") { $strClean="0123456789."; $bolHighOrder=false; } else if ($strType=="VendorTxCode") { $strClean="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_."; $bolHighOrder=false; } else { $strClean=" ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.,'/{}@():?-_&�$=%~<>*+\""; $bolHighOrder=true; } $strCleanedText=""; $iCharPos = 0; do { // Only include valid characters $chrThisChar=substr($strRawText,$iCharPos,1); if (strspn($chrThisChar,$strClean,0,strlen($strClean))>0) { $strCleanedText=$strCleanedText . $chrThisChar; } else if ($bolHighOrder==true) { // Fix to allow accented characters and most high order bit chars which are harmless if (bin2hex($chrThisChar)>=191) { $strCleanedText=$strCleanedText . $chrThisChar; } } $iCharPos=$iCharPos+1; } while ($iCharPos= 191) { $strCleanedText = $strCleanedText . $chrThisChar; } } $iCharPos = $iCharPos + 1; } return $strCleanedText; } // Function to check validity of email address entered in form fields function is_valid_email($email) { $result = TRUE; if(!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$", $email)) { $result = FALSE; } return $result; } /************************************************************* Send a post request with cURL $url = URL to send request to $data = POST data to send (in URL encoded Key=value pairs) *************************************************************/ function requestPost($url, $data){ // Set a one-minute timeout for this script set_time_limit(60); // Initialise output variable $output = array(); // Open the cURL session $curlSession = curl_init(); // Set the URL curl_setopt ($curlSession, CURLOPT_URL, $url); // No headers, please curl_setopt ($curlSession, CURLOPT_HEADER, 0); // It's a POST request curl_setopt ($curlSession, CURLOPT_POST, 1); // Set the fields for the POST curl_setopt ($curlSession, CURLOPT_POSTFIELDS, $data); // Return it direct, don't print it out curl_setopt($curlSession, CURLOPT_RETURNTRANSFER,1); // This connection will timeout in 30 seconds curl_setopt($curlSession, CURLOPT_TIMEOUT,30); //The next two lines must be present for the kit to work with newer version of cURL //You should remove them if you have any problems in earlier versions of cURL curl_setopt($curlSession, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($curlSession, CURLOPT_SSL_VERIFYHOST, 1); curl_setopt($curlSession, CURLOPT_SSLVERSION,1); //Send the request and store the result in an array $rawresponse = curl_exec($curlSession); //Store the raw response for later as it's useful to see for integration and understanding $_SESSION["rawresponse"]=$rawresponse; //Split response into name=value pairs $response = split(chr(10), $rawresponse); // Check that a connection was made if (curl_error($curlSession)){ // If it wasn't... $output['Status'] = "FAIL"; $output['StatusDetail'] = curl_error($curlSession); } // Close the cURL session curl_close ($curlSession); // Tokenise the response for ($i=0; $i $intMaxLength)) { return FIELD_INVALID_MAXIMUM_LENGTH_EXCEEDED; } elseif ($strInputValue != cleanInput2($strInputValue, $strAllowableChars, $blnAllowAccentedChars)) { return FIELD_INVALID_BAD_CHARACTERS; } elseif (($blnIsRequired == TRUE) && (strlen($strInputValue) < $intMinLength)) { return FIELD_INVALID_MINIMUM_LENGTH_NOT_MET; } elseif (($blnIsRequired == FALSE) && (strlen($strInputValue) > 0) && (strlen($strInputValue) < $intMinLength)) { return FIELD_INVALID_MINIMUM_LENGTH_NOT_MET; } else { return FIELD_VALID; } } // A generic function to inspect and validate a string from user input based on a Regular Expression pattern. // Parameter "strInputValue" is the value to perform validation on. // Parameter "strRegExPattern" is a Regular Expression string pattern used to validate against "strInputValue". // Parameter "blnIsRequired" accepts a boolean value which specifies whether "strInputValue" must have a non-null and non-empty value. // Returns a result from one of the field validation constants that begin with "FIELD_" function validateStringWithRegExp($strInputValue, $strRegExPattern, $blnIsRequired) { if ($blnIsRequired == TRUE && strlen($strInputValue) == 0) { return FIELD_INVALID_REQUIRED_INPUT_VALUE_MISSING; } elseif (strlen($strInputValue) > 0) { if (preg_match($strRegExPattern, $strInputValue)) { return FIELD_VALID; } else { return FIELD_INVALID_BAD_FORMAT; } } else { return FIELD_VALID; } } // Maps a Field Validation constant value to a string representing a user friendly validation error message. // Parameter "strFieldLabelName" is the display name of the form field to use in the returned message. function getValidationMessage($fieldValidationCode, $strFieldLabelName) { $strReturn = ""; switch ($fieldValidationCode) { case FIELD_INVALID_BAD_CHARACTERS: $strReturn = "Please correct " . $strFieldLabelName . " as it contains disallowed characters."; break; case FIELD_INVALID_BAD_FORMAT: $strReturn = "Please correct " . $strFieldLabelName . " as the format is invalid."; break; case FIELD_INVALID_MINIMUM_LENGTH_NOT_MET: $strReturn = "Please correct " . $strFieldLabelName . " as the value is not long enough."; break; case FIELD_INVALID_MAXIMUM_LENGTH_EXCEEDED: $strReturn = "Please correct " . $strFieldLabelName . " as the value is too long."; break; case FIELD_INVALID_REQUIRED_INPUT_VALUE_MISSING: $strReturn = "Please enter a value for " . $strFieldLabelName . " where requested below."; break; case FIELD_INVALID_REQUIRED_INPUT_VALUE_NOT_SELECTED: $strReturn = "Please select a value for " . $strFieldLabelName . " where requested below."; break; } return $strReturn; } /************ Global definitions ***************/ // Defines filter types used for a parameter in the cleanInput() function. Define("CLEAN_INPUT_FILTER_ALPHABETIC", "alpha"); Define("CLEAN_INPUT_FILTER_ALPHABETIC_AND_ACCENTED", "alpha and accented"); Define("CLEAN_INPUT_FILTER_ALPHANUMERIC", "alphaNumeric"); Define("CLEAN_INPUT_FILTER_ALPHANUMERIC_AND_ACCENTED", "alphaNumeric and accented"); Define("CLEAN_INPUT_FILTER_NUMERIC", "numeric"); Define("CLEAN_INPUT_FILTER_TEXT", "text"); Define("CLEAN_INPUT_FILTER_WIDEST_ALLOWABLE_CHARACTER_RANGE", "text"); // Defines a set of values used as outcomes in field validation functions such as isValidAddressField. Define("FIELD_VALID", "valid"); Define("FIELD_INVALID", "invalid"); Define("FIELD_INVALID_BAD_CHARACTERS", "bad characters"); Define("FIELD_INVALID_BAD_FORMAT", "bad format"); Define("FIELD_INVALID_MAXIMUM_LENGTH_EXCEEDED", "maximum exceeded"); Define("FIELD_INVALID_MINIMUM_LENGTH_NOT_MET", "minimum not met"); Define("FIELD_INVALID_REQUIRED_INPUT_VALUE_MISSING", "missing required value"); Define("FIELD_INVALID_REQUIRED_INPUT_VALUE_NOT_SELECTED", "required value not selected"); ?> Order Scalewizard Now!
Scalewizard - Eliminate Hard Water Problems
Stop Hard Water Problems And Save Fuel Costs With Scalewizard Electronic Water Conditioner
Home Button
The Problems of Hard Water
The benefits of Scalewizard
How it works
Installation
FAQ's
Prices & Ordering
About  Us
contact Us
Buy Scalewizard Now
Product Guarantee
holder


 

STEP 1

Order Now - Save Time and Money

We guarantee that the Scalewizard will work for you or your money back.
Please call 01491 419200 for details.

All inclusive of 10 year warranty


 
  Product  

Price Each

(Inc. VAT)

Quantity
 
  Scalewizard  

Scalewizard

Inc. FREE P&P
and 10 Yr warranty

 

Buy Now
 
  Promo Code:  
 
             
 

Home * The Problems of Hard Water * The Benefits of Scalewizard * How it Works
Installation * FAQ's * Prices & Ordering * About Us * Terms & Conditions * Contact Us