-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvalidator.php
31 lines (30 loc) · 893 Bytes
/
validator.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
29
30
31
<?php
header("Content-Type: text/html; charset=UTF8",true);
?>
<?php
$latitude = trim(@$_POST['latitude']);
$longitude = trim(@$_POST['longitude']);
$area = trim(@$_POST['area']);
$erros = 1;
$enviar = @$_POST['calcular'];
if($enviar){
if(floatval($latitude == "")){
$erros++;
echo "<small class=\"erro\">*** Favor verificar o campo Latitude.</small><br />";
}
if(floatval($longitude == "")){
$erros++;
echo "<small class=\"erro\">*** Favor verificar o campo Longitude.</small><br />";
}
if(floatval($area == "")){
$erros++;
echo "<small class=\"erro\">*** Favor verificar o campo Área.</small><br />";
}
if ($erros <= 1) {
$latitude = floatval($latitude);
$longitude = floatval($longitude);
$area = floatval($area);
header("Location: resultado.php?lat=$latitude&long=$longitude&area=$area");
}
}
?>