首頁 >php教程 >PHP源码 >即时网站截图

即时网站截图

PHP中文网
PHP中文网原創
2016-05-25 17:03:291121瀏覽


           

2. [代码]screenshot_it.php    

<?php
$x = $_REQUEST[&#39;x&#39;];
$y = $_REQUEST[&#39;y&#39;];
$format = $_REQUEST[&#39;format&#39;];
$site = $_REQUEST[&#39;site&#39;];
$surl = &#39;http://0907.org/screenshot/screenshot_it.php?site=&#39;.$site.&#39;&x=&#39;.$x.&#39;&y=&#39;.$y.&#39;&format=&#39;.$format;
if($_REQUEST[&#39;format&#39;] == &#39;PNG&#39;) {
$ifm = &#39;png&#39;;
} else {
$ifm = &#39;jpg&#39;;
}
$imt = &#39;image/&#39;.$ifm;
$ifn = &#39;screenshot.&#39;.$ifm;
if(isset($_REQUEST[&#39;preview&#39;])) {
$iurl = &#39;http://域名/子目录/screenshot_it.php?site=&#39;.$site.&#39;&x=&#39;.$x.&#39;&y=&#39;.$y.&#39;&format=&#39;.$format; 
//例如:http://0907.org/screenshot/screenshot_it.php?site=&#39;.$site.&#39;&x=&#39;.$x.&#39;&y=&#39;.$y.&#39;&format=&#39;.$format;
$gwptitle = $_REQUEST[&#39;site&#39;].&#39; blog.0907.org&#39;;
include_once("../css.php");   
//这里可以删除呦!因为是CSS
 
echo &#39;

&#39;;
} else {
header("Content-type: $imt");
header("Content-Disposition: attachment; filename= $ifn");
readfile($surl);
}
?>

           

       

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn