moving geo files to new experiments subdir
[lhc/web/wiklou.git] / experiments / geo / geomaker.php
1 <?
2
3 print "
4 <html>
5 <head></head>
6 <body>
7 " ;
8
9 $image = "./Germany_Map.jpg" ;
10
11 if ( isset ( $_GET['coords'] ) ) $coords = $_GET['coords'] ;
12 else $coords = "" ;
13
14 $x = $y = -1 ;
15 foreach ( $_GET AS $k => $v )
16 {
17 $a = explode ( "," , str_replace ( "?" , "" , $k ) ) ;
18 if ( $v == "" AND count ( $a ) == 2 )
19 {
20 $x = array_shift ( $a ) ;
21 $y = array_shift ( $a ) ;
22 }
23 }
24
25 if ( $coords != "" ) $coords = explode ( ";" , $coords ) ;
26 else $coords = array () ;
27
28 if ( $x != -1 AND $y != -1 ) # Adding coordinates
29 {
30 $coords[] = "{$x},{$y}" ;
31 }
32
33 $c2 = $coords ;
34 if ( count ( $c2 ) > 0 ) array_pop ( $c2 ) ;
35 $c2 = implode ( ";" , $c2 ) ;
36
37 $coords = implode ( ";" , $coords ) ;
38
39 print "
40 <a href='./geomaker.php?coords={$coords}&'><image src='{$image}' ismap/></a>
41 " ;
42
43 print "<br/><a href='geomaker.php?coords={$c2}'>Remove last coordinates</a>" ;
44 print " | <a href='geomaker.php'>Reset</a>" ;
45
46 print "<br/>Coordinates so far:<br>\n" ;
47 print str_replace ( ";" , " " , $coords ) ;
48
49 print "
50 </body>
51 </html>" ;
52
53 ?>