Project

General

Profile

« Previous | Next » 

Revision e2b1b9c1

IDe2b1b9c15f4dd2a258971021f9e9f441f4182be4
Parent 6156a9b6
Child fe12dd81

Added by Jocelyn Delande over 8 years ago

input validation on show_capline.php

Files

  • added
  • modified
  • copied
  • renamed
  • deleted

View differences

Changesets

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" />