hi steve
whitespace at the end of file was a direct hit , thanks
‡ propos whitespace...
to make this delegate class really foolproof, i need to strip all of the whitespace and replace it with a plus sign (+)
I was experimenting with validation this morning but the built-in validation rules of quickform don't really match.
Then I went over to the delegate class of the users table to implement a php replacement eg:
seach = array(" ", ".");
$replace = array("+", "+");
$valid_adr = str_replace($seach, $replace, $nonvalid_adr);
but this leads to the following error:
Wrong parameter count for str_replace()
The whole function looks like this:
-----------------------------------------------------------------------
strval('strasse').'+'.$record->strval('hausnr').'+'.$record->strval('plz').'+'.$record->strval('ort'));
}
function beforeSave(&$record){
$auth =& Dataface_AuthenticationTool::getInstance();
$key='ABQIAAAAooZ_SZteboYmTOL4jxD62BSOvuGUx-vwd1f9BNBwMyfFwZh75RRNqIYghOSJherZZaxKd-Rvj_PH1Q';
$nonvalid_adr = $record->val('full_address');
// ----------------------------
$seach = array(" ", ".");
$replace = array("+", "+");
$valid_adr = str_replace($seach, $replace, $nonvalid_adr);
// --------------------------------------------------------
$url ="
http://maps.google.com/maps/geo?q=$valid_adr&key=$key&output=csv";
$geo = file_get_contents($url,'r');
$geo_array = explode(',',$geo);
$lat = $geo_array[2];
$lng = $geo_array[3];
$record->setValue('lat', $lat);
$record->setValue('lng', $lng);
}
}
?>
---------------------------------------------------------------------
well... i'cant see any syntactical errors (that doesnt't mean much)
maybe you with your "PHP eagle eye" have an idea?
cheers
martin