PASTE-IT!

Holding 721M in 51809 pastes. Meet us at #paste-it.net!
Try our Mozilla Jetpack clipboard paster and our Chrome extension!
 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
<?
$url = urlencode(htmlentities($_GET['url'], ENT_NOQUOTES));
if(isset($url)){
	$source = file_get_contents($url);
	$source = htmlspecialchars($source);
	$uhoh[0] = '/<?/';
	$uhoh[1] = '/<%/';
	$uhoh[2] = '/?>/';
	$uhoh[3] = '/%>/';
	$phew[0] = '&lt;?';
	$phew[1] = '&lt;%';
	$phew[2] = '?&gt;';
	$phew[3] = '%&gt;';
	$source = preg_replace($uhoh, $phew, $source);
}
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
	<title> <?if(isset($url)){echo 'View page source of '.urldecode($url);}else{echo'View source of remote files';}?></title>
</head>

<body>

<?php
if(!isset($url)){
	echo '<form action="'.$PHP_SELF.'" method="get">
			<p>
			<input type="text" name="url" value="http://yoururlhere/file.htm" />
			</p>
		  </form>';
}
else{
	echo $source;
}
?>

</body>
</html>
Paste by
mrevil,
301 day(s) ago
03:48 02-10-2009
in syntax