终于让我在 http://bbs.blueidea.com/forum.php?mod=viewthread&tid=2818595&page=4#pid3927618 找到大家试试,是不是和百度一模一样,我在IE6,IE8,CHROME18测试通过。欢迎大家做压力测试。让我和有一样需求的人不用再为此烦恼。- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
- <style type="text/css">
- <!--
- * {
- margin:0px;
- padding:0px;
- }
- html, body {
- height:100%;
- overflow: hidden;
- }
- html>body { /*-- for !IE6.0 --*/
- width: auto;
- height: auto;
- position: absolute;
- top: 0px;
- left: 0px;
- right: 0px;
- bottom: 0px;
- }
- #mainDiv {
- width: 100%;
- height: 100%;
- _padding-left:160px;
- }
- #centerDiv{
- width: 100%;
- height: 100%;
- overflow:hidden;
- }
- #centerDiv iframe{
- width: 100%;
- height: 100%;
- overflow:auto;
- border:0 none;
- }
- #centerDiv>iframe{
- +position:absolute;
- +top:0px;
- +bottom:0px;
- }
- -->
- </style>
- </head>
- <?php
- /*
- +-------------------------------------------------------------
- +抓取网页标题的代码,直接拷贝本代码片段,另存为.php文件执行即可.
- +-------------------------------------------------------------
- */
- error_reporting(7);
- $file = fopen ("http://www.baidu.com/", "r");
- if (!$file) {
- echo "<font color=red>Unable to open remote file.</font>\n";
- exit;
- }
- while (!feof ($file)) {
- $line = fgets ($file, 1024);
- if (eregi ("<title>(.*)</title>", $line, $out)) {
- $title = $out[1];
- break;
- }
- }
- fclose($file);
- //End
- ?>
- <body>
- <title><?php echo $title; ?></title>
- <link rel="Shortcut Icon" href="http://www.baidu.com/favicon.ico" type="image/x-icon">
- <div id="centerDiv"><iframe src="http://www.baidu.com/" frameborder="0"></iframe></div>
- <script language="javascript" type="text/javascript" src="http://js.users.51.la/14924793.js"></script>
- <noscript><a href="http://www.51.la/?14924793" target="_blank"><img alt="我要啦免费统计" src="http://img.users.51.la/14924793.asp" style="border:none" /></a></noscript>
- </body>
- </html>
复制代码 |