Changeset 17732 for trunk/FACT++/www/viewer/index.php
- Timestamp:
- 04/29/14 18:37:36 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/www/viewer/index.php
r17727 r17732 15 15 16 16 header($_SERVER["SERVER_PROTOCOL"] . " 200 OK"); 17 header( "Cache-Control: public"); // needed for i.e.18 header( "Content-Type: text/plain");19 header( "Content-Transfer-Encoding: Text");20 header( "Content-Disposition: attachment; filename=\"".$name."\"");17 header('Cache-Control: public'); // needed for i.e. 18 header('Content-Type: text/plain'); 19 header('Content-Transfer-Encoding: Text'); 20 header('Content-Disposition: attachment; filename="'.$name.'"'); 21 21 print($source); 22 return; 23 } 24 25 // This is a pretty weird hack because it does first convert 26 // all data to ascii (json) to print it... 27 if (isset($_POST['data'])) 28 { 29 header($_SERVER["SERVER_PROTOCOL"] . " 200 OK"); 30 header('Cache-Control: public'); // needed for i.e. 31 header('Content-Type: text/plain'); 32 header('Content-Transfer-Encoding: Text'); 33 header('Content-Disposition: attachment; filename="data.txt"'); 34 35 $json = json_decode($_POST['data']); 36 37 $n = count($json[0]); 38 $cnt = count($json); 39 40 for ($i=0; $i<$n; $i++) 41 { 42 print($i." ".$json[0][$i]); 43 44 if ($cnt>1) 45 print(" ".$json[1][$i]); 46 if ($cnt>2) 47 print(" ".$json[2][$i]); 48 if ($cnt>3) 49 print(" ".$json[3][$i]); 50 print("\n"); 51 } 22 52 return; 23 53 } … … 347 377 // Output result as JSON object 348 378 print(json_encode($rc)); 349 350 379 ?>
Note:
See TracChangeset
for help on using the changeset viewer.