-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathloopback.php
56 lines (46 loc) · 1.72 KB
/
loopback.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
/**
* This file is part of szczyglis/php-ultra-small-proxy.
*
* (c) Marcin Szczyglinski <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
session_start();
/**
* @package szczyglis/php-ultra-small-proxy
* @author Marcin Szczyglinski <[email protected]>
* @copyright 2022 Marcin Szczyglinski
* @license http://www.opensource.org/licenses/MIT The MIT License
* @link https://github.com/szczyglis-dev/php-ultra-small-proxy
*/
echo '<h1>ULTRA SMALL PROXY - LOOPBACK TEST</h1><hr>';
echo '<h1>URLS REWRITE TEST</h1>';
echo '<h5>(check the page source here)</h5>';
echo '<link rel="stylesheet" type="text/css" href="some_stylesheet.css"><br/>';
echo '<link rel="stylesheet" type="text/css" href="some_file_not_css"><br/>';
echo '<script src="some_js_script"></script><br/>';
echo '<img src="some_image_should_be_prefixed.png"><br/>';
echo '<a href="some_file.html">TEST LINK</a><br/><hr>';
echo '<h1>SESSION TEST | CURRENT SID: ' . session_id() . '</h1><hr>';
echo '<h1>REQUEST METHOD: ' . $_SERVER['REQUEST_METHOD'] . '</h1><hr>';
function dump($var, $title = null)
{
if (!is_null($title)) echo '<h2>' . $title . '</h2>';
echo '<div class="vars"><pre>';
var_dump($var);
echo '</pre></div>';
}
setcookie('test_cookie1', 'cookie1_value');
setcookie('test_cookie2', 'cookie2_value');
setcookie('test_cookie3', 'cookie3_value');
echo '<h1>VARS DEBUG</h1>';
dump($_COOKIE, '$_COOKIE');
dump($_GET, '$_GET');
dump($_POST, '$_POST');
echo '<hr><h1>FORM SUBMIT TEST</h1>';
echo '<form method="POST" action="">
<input type="text" name="form_test" value="test" />
<input type="submit" value="SUBMIT" />
</form>';