In one of my forms you can register yourself and you have to fill out Street name, House number, Zip code.
What I like to offer is that on base of Zip code and House number the street name is been searched and filled into the field "Street name"
That is possible, however how to incorporate this into my form?
Hereby a link to a site that can handle this and the PHP code to be used, but where and how to place this code ???
(this link works for the adresses in The Netherlands!
https://bwnr.nl/pcapi.php
Code: Select all
(change 1234AB for a zip code!)
<?php
$pc = "1234AB";
$hn = 1;
$tv = "a";
$getadrlnk = 'https://bwnr.nl/postcode.php?pc='.urlencode($pc).'&hn='.urlencode($hn).'&tv='.urlencode($tv).'&tg=data';
$result = file_get_contents($getadrlnk);
if ($result=="Geen resultaat.") {echo $result;} else {
$adres = explode(";",$result);
$str = $adres[0];
$pl = $adres[1];
$lat = $adres[2];
$lon = $adres[3];
$gm = $adres[4];
echo "
straat : $str<br>
plaats : $pl<br>
lat : $lat<br>
lon : $lon<br>
googlemaps : $gm<br>";
}
?>