For a order form I want to check is someone has filled in a correct VAT number. I found a site and some code to check this. The site returns a true of a false.
The code I have written, never gives back a 'false' but I can't find out why. Can someome see what is wrong with it? The landcode is the first 2 characters of the filled in 'vatnumber'.
Is there BTW a way to 'debug' in Chronoforms? So that I can see what values the variables get during the process?
The code I have written, never gives back a 'false' but I can't find out why. Can someome see what is wrong with it? The landcode is the first 2 characters of the filled in 'vatnumber'.
<?php
$vatnumber = $form->data['vatnumber'];
$land = substr($vatnumber, 0, 2);
$btwnummer = substr($vatnumber, 2);
$result = file_get_contents("http://isvat.appspot.com/".$land."/".$btwnummer."/", "r");
if($result == "false") {
$form->validation_errors['vatnumber'] = "Sorry, the VATnumber is invalid. Please try again.";
return false;
}
?>
Is there BTW a way to 'debug' in Chronoforms? So that I can see what values the variables get during the process?