标题: 高手来看看php.
作者: 九尾狐 @Ta
时间: 2012-08-14
<?php
error_reporting(0);
$time=$_GET['time'];
$num=$_GET['num'];
$siteid=$_GET['siteid'];
$classid=$_GET['classid'];
$domain=$_GET['domain'];
$sid=$_GET['sid'];if(!$siteid or !$classid or !$domain or !$sid or!$time or $num>100){
echo"<font color='red'>输入不完整<a href='index.php?q=2'>返回重新填写</a></font>";
}else{
?>
<html>
<head>
<title>页面</title>
<META HTTP-EQUIV="Refresh" content="3">
</head>
<body>
<?php
ignore_user_abort(true);
set_time_limit(0); //设置程序执行时间无限制
$txt=file('reply.txt');
for($j=1;$j<$num;$j++) {
shuffle($txt);
#要提交的数据串
$postdata="action=gomod&book_title=$txt[2]&siteid=$siteid&lpage=1&book_content=$txt[3]&classid=$classid&sid=$sid";
#要提交到的网址
$url=$domain."/bbs/book_view_add.aspx";
$optionpost=array('http'=>array('method'=>"POST",'timeout'=>"60",'header'=>"User-Agent:Mozilla/4.0(compatible;MSIE 7.0;Windows NT 6.0;SLCC1;.NET CLR 2.0.50727;Media Center PC 5.0;.NET CLR 3.5.21022;.NET CLR 3.0.04506;CIBA)\r\nAccept:*/*",'content'=>$postdata));
$file=file_get_contents($url,false,stream_context_create($optionpost));
echo$file;
sleep($time);
}
?>
</body>
</html>
<?php
}
?>呵呵,我想大家都知道干嘛用的!
我想问那个获取.txt的时候,如果我想从获取2个不同的.txt中获取,该怎么修改?
[隐藏样式|查看源码]