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

即时网站截图

PHP中文网
PHP中文网原创
2016-05-25 17:03:291133浏览


           

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