-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
63 lines (50 loc) · 1.23 KB
/
Copy pathindex.php
File metadata and controls
63 lines (50 loc) · 1.23 KB
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
57
58
59
60
61
62
63
<?php
require_once(dirname(__FILE__) . '/conf/config.php');
require_once(dirname(__FILE__) . '/lib/PHPProxy.class.php');
$url = $_REQUEST[URL_PARAM_NAME];
if ($url == ''):
?>
<html>
<head>
<title>PHP Proxy</title>
<link href="css/style.css" type="text/css" rel="stylesheet" />
</head>
<body>
<h1>Proxy</h1>
<form method="post" action="index.php">
<input type="hidden" name="action" value="new" />
<table>
<tr>
<td><label for="url">URL</label></td>
<td><input id="url" name="<?php echo URL_PARAM_NAME ?>" size="100" /></td>
</tr>
<tr>
<td colspan="2" align="right">
<input type="submit" value="Go" />
</td>
</tr>
</table>
</form>
</body>
</html>
<?php
else:
$decoded = base64_decode($url);
if ($decoded === FALSE) {
$url = base64_encode($url);
}
if ($_REQUEST['action'] == 'new') {
header('Location: ' . INDEX_FILE_NAME . '?' . URL_PARAM_NAME . '=' . base64_encode($url));
die();
}
if ($_GET['proxy_password']) {
$username = base64_decode($_GET['proxy_username']);
$password = base64_decode($_GET['proxy_password']);
$proxy = new PHPProxy($url, $username, $password);
}
else {
$proxy = new PHPProxy($url);
}
$proxy->handleRequest();
endif;
?>