分页: 1 / 1

php抓取html的问题

发表于 : 2007-11-23 16:52
cgk100
我用php做了抓取一个网站的html,以下是代码,但是得到的html,都是客户端的html,也就是在ie中右键查看源代码的这种html,我想得到服务器端的html,请问php中抓取网页html的其他函数,有没有不是如此的原理的呢?
我也用了curl,fopen但是都是客户端的html。


<form id="form" method="POST" action="gethtml.php">
url:<input type="text" name="url">
<input type="submit" >
</form>
<?php
@$url=$_POST['url'];
if ($url=='')
{ echo 'please enter url';
exit;
}
$str=file_get_contents($url);
if ($str===false)
{
echo 'get content failed';
exit;
}
echo htmlspecialchars($str);



?>

发表于 : 2007-11-25 3:06
yiller
老大 你要下服务器端代码啊? 除非你黑了它拿到SHELL 否则不可能

发表于 : 2007-11-25 8:20
cgk100
我表达的有点问题呀 :(