postcodeCheck.php
Gesponsorde koppelingen
PHP script bestanden
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
if(basename($_SERVER['PHP_SELF']) == basename(__FILE__)):
if($_SERVER['REQUEST_METHOD'] == 'GET'):
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://api.postcode.nl/rest/addresses/'.$_GET['postc'].'/'.$_GET['huisnr']);
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($curl, CURLOPT_USERPWD, "Key:Secret"); // Hier dus je key en secret van postcode.nl
$return_data = curl_exec($curl);
curl_close($curl);
print $return_data;
else:
header("Location: /");
endif;
else:
header("Location: /");
endif;
?>
if(basename($_SERVER['PHP_SELF']) == basename(__FILE__)):
if($_SERVER['REQUEST_METHOD'] == 'GET'):
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://api.postcode.nl/rest/addresses/'.$_GET['postc'].'/'.$_GET['huisnr']);
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($curl, CURLOPT_USERPWD, "Key:Secret"); // Hier dus je key en secret van postcode.nl
$return_data = curl_exec($curl);
curl_close($curl);
print $return_data;
else:
header("Location: /");
endif;
else:
header("Location: /");
endif;
?>