PHP Code:
<?php
header('Content-Type: text/html; charset=utf-8');
echo '<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Source code viewer</title>
<meta http-equiv="Pragma" content="no-cache" />
</head>
<body>';
if(isset($_GET['url']) && substr($_GET['url'],0,7) == 'http://')
{
$source = file_get_contents($_GET['url']);
echo '<div>Source code</div><div>'.htmlspecialchars($source).'</div><hr/>';
}
echo '<form action="'.$_SERVER['PHP SELF'].'" method="get">
<div>
Source URL:
<input type="text" name="url" value="http://" />
<input type="submit" value="Show source" />
</div>
</form>
</body>
</html>';
?>
Comment