xref: /PHP-5.3/ext/curl/tests/responder/get.php (revision e8eab79a)
1<?php
2  $test = isset($_GET['test']) ? $_GET['test'] : null;
3  switch($test) {
4    case 'post':
5      var_dump($_POST);
6      break;
7    case 'getpost':
8      var_dump($_GET);
9      var_dump($_POST);
10      break;
11    case 'referer':
12      echo $_SERVER['HTTP_REFERER'];
13      break;
14    case 'useragent':
15      echo $_SERVER['HTTP_USER_AGENT'];
16      break;
17    case 'httpversion':
18      echo $_SERVER['SERVER_PROTOCOL'];
19      break;
20    case 'cookie':
21      echo $_COOKIE['foo'];
22      break;
23    case 'encoding':
24      echo $_SERVER['HTTP_ACCEPT_ENCODING'];
25      break;
26    case 'contenttype':
27      header('Content-Type: text/plain;charset=utf-8');
28      break;
29    case 'file':
30      if (isset($_FILES['file'])) {
31          echo $_FILES['file']['name'] . '|' . $_FILES['file']['type'];
32      }
33      break;
34    default:
35      echo "Hello World!\n";
36      echo "Hello World!";
37      break;
38  }
39?>
40