Demo: http://siekuti.com/tools/viewsource.php
Tải về View-source-DQH.zip (979 bytes) hoặc xem code
Nguồn: SIEKUTI
Tải về View-source-DQH.zip (979 bytes) hoặc xem code
PHP:
<html>
<head>
<title>View Source By DinhQuocHan</title>
<meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8"/>
</head>
<body>
<?php
echo '<h2 class="phdr">View Source by Dinh Quoc Han</h2>'.
'<div class="list2">'.
'<form method="POST" id="view" />'.
'<center>URL: <input type="text" name="url" value="'.($_POST ? $_POST['url'] : 'http://').'" size="15" id="url" /><br>'.
'<input type="submit" name="ok" value="OK" /></center></div>';
if($_POST){
if(!preg_match('#http:\/\/#',$_POST['url'])) $_POST['url'] = 'http://'.$_POST['url'];
$f = @fopen($_POST['url'],'r');
If(!$f) {
echo '<div class="rmenu">Site not found !</div>'; require('../incfiles/end.php'); exit; }
$content = file($_POST['url']);
$out = '';
foreach($content as $s) $out .= $s;
echo '<div class="phdr">View site: <b>'.$_POST['url'].'</b></div>';
if($out)
echo '<div class="list2">'.nl2br(htmlspecialchars($out)).'</div>'; else
echo '<div class="rmenu">Site not found !</div>';
}
?>
<p><small>© 2012</small></p>
</body></html>