www.gusucode.com > 搜一次CMS电影程序 PHP 1.5源码程序 > admin/collect/vodcollect/ajax.php
<?php include "../../../include/conn.php"; include "../../../include/function.php"; include "../../admin_version.php"; include "../../admin_loginstate.php"; header("Content-type: text/html;charset=gb2312"); $action=SafeRequest("action","get"); if($action=="getcheck"){ getcheck(); } else{ $id=SafeRequest("id","get"); $ps=SafeRequest("ps","get"); $pe=SafeRequest("pe","get"); $str=SafeRequest("str","get"); if($id=='1'){ die("<input name=\"S_UrlStr\" type=\"text\" id=\"S_UrlStr\" value=\"".$str."\" style=\"width:318px; height:20px;\"/> <font color=#FF0000>*</font><a onclick=\"getcheck();\">测试获取>></a><span id=\"getinfo\"></span>"); } elseif($id=='2'){ die("<input name=\"S_UrlStr\" type=\"text\" id=\"S_UrlStr\" value=\"".$str."\" style=\"width:318px; height:20px;\"/> 分类页参数 <span style=\"color:red;\">{\$ID}</span><br> <font color=#FF0000>标准格式:http://www.xxxxxx.com/list/{\$ID}.html</font><br> 采集范围: <input type='text' name=\"S_PageGo\" id=\"S_PageGo\" size=4 value=\"".$ps."\"> To <input type=\"text\" name=\"S_PageEnd\" id=\"S_PageEnd\" size=4 value=\"".$pe."\"> 例如:1 - 9"); } elseif($id=='3'){ $str=ReplaceStr($str,'#',chr(13).chr(10)); die(" <textarea name=\"S_UrlStr\" id=\"S_UrlStr\" cols=\"60\" rows=\"5\">".$str."</textarea><br/><font color=#FF0000>* 每行为一个分类页地址,请用回车键换行!</font>"); } elseif($id=='4'){ die("<input name=\"S_UrlStr\" id=\"S_UrlStr\" type=\"text\" value=\"".$str."\" style=\"width:318px; height:20px;\"/> <font color=#FF0000>*</font> 内容页参数 <span style='color:red;'>{\$ID}</span><br> <font color=#FF0000>标准格式:http://www.xxxxxx.com/view/{\$ID}.html</font><br> 采集范围: <input type=\"text\" name=\"S_PageGo\" id=\"S_PageGo\" size=4 value=\"".$ps."\"> To <input type=\"text\" name=\"S_PageEnd\" id=\"S_PageEnd\" size=4 value=\"".$pe."\"> 例如:1 - 9"); } else{ die("<input name=\"S_UrlStr\" type=\"text\" id=\"S_UrlStr\" value=\"".$str."\" style=\"width:318px; height:20px;\"/> <font color=#FF0000>*</font><a onclick=\"getcheck();\">测试获取>></a><span id=\"getinfo\"></span>"); } } function getcheck(){ $url=SafeRequest("url","get"); if(function_exists("file_get_contents")){ for($i=0;$i<4;$i++){ $con=@file_get_contents($url); if(IsNul($con)){ break; } } if(!IsNul($con)){ $con=geturl($url); } } else{ $con=geturl($url); } if(!IsNul($con)){ die("<font color=red>对不起,抓取不到$url页面的内容!</font>"); } else{ die("<font color=green>恭喜!正确的地址~</font>"); } } ?>