Home > php教程 > PHP源码 > body text

即时网站截图

PHP中文网
Release: 2016-05-25 17:03:29
Original
1118 people have browsed it


           

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

           

       

Related labels:
source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template