1
0
mirror of https://github.com/php/php-src.git synced 2026-03-27 17:52:16 +01:00
Files
archived-php-src/ext/curl/tests/responder/get.php
datibbaw 488e64dbe4 Allow NULL as value for CURLOPT_CUSTOMREQUEST option.
Added test case.

Refactored the code to isolate the string handling. Fixed return values to use SUCCESS and FAILURE.

Removed unused error variable.

Indentation fix.
Removed the ugly goto.
2014-02-28 18:27:22 +08:00

43 lines
975 B
PHP

<?php
$test = isset($_GET['test']) ? $_GET['test'] : null;
switch($test) {
case 'post':
var_dump($_POST);
break;
case 'getpost':
var_dump($_GET);
var_dump($_POST);
break;
case 'referer':
echo $_SERVER['HTTP_REFERER'];
break;
case 'useragent':
echo $_SERVER['HTTP_USER_AGENT'];
break;
case 'httpversion':
echo $_SERVER['SERVER_PROTOCOL'];
break;
case 'cookie':
echo $_COOKIE['foo'];
break;
case 'encoding':
echo $_SERVER['HTTP_ACCEPT_ENCODING'];
break;
case 'contenttype':
header('Content-Type: text/plain;charset=utf-8');
break;
case 'file':
if (isset($_FILES['file'])) {
echo $_FILES['file']['name'] . '|' . $_FILES['file']['type'];
}
break;
case 'method':
echo $_SERVER['REQUEST_METHOD'];
break;
default:
echo "Hello World!\n";
echo "Hello World!";
break;
}
?>