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

即时网站截图

PHP中文网
PHP中文网Original
2016-05-25 17:03:291121browse


           

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);
}
?>

           

       

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn