Projet

Général

Profil

« Précédent | Suivant » 

Révision e2b1b9c1

IDe2b1b9c15f4dd2a258971021f9e9f441f4182be4
Parent 6156a9b6
Enfant fe12dd81

Ajouté par Jocelyn Delande il y a plus de 9 ans

input validation on show_capline.php

Fichiers

  • ajouté
  • modifié
  • copié
  • renommé
  • supprimé

Voir les différences

Révisions

show_capline.php
1
<?php 
2
$fields_spec = array(
3
  'cap' => array('numeric'),
4
  'org_lat' => array('numeric'),
5
  'org_lon' => array('numeric'),
6
  'dist' => array('numeric'),
7
  'title' => array(),
8
);
9

  
10
$validator = new FormValidator($fields_spec);
11

  
12
$is_valid = $validator->validate($_GET);
13

  
14

  
15
if ($is_valid) {
16
  $input = $validator->sane_values();
17
  if (isset($input['cap'], $input['org_lat'], $input['org_lon'])) {
18
    $cap = $input['cap'];
19
    $org_lat = $input['org_lat'];
20
    $org_lon = $input['org_lon'];
21
    $show_capline = true;
22
  } else {
23
    $show_capline = false;
24
  }
25
}
26

  
27
 ?>
28

  
1 29
<head>
2 30
  <title>Visualisation axe horizontal sur OSM</title>
3 31
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />