资源预览内容
第1页 / 共4页
第2页 / 共4页
第3页 / 共4页
第4页 / 共4页
亲,该文档总共4页全部预览完了,如果喜欢就下载吧!
资源描述
Lockup.php代码如下:?php $symbol=AMZN; /提取信息的关键词 echo stock quote for : . .$symbol.; /原始信息的地址,下载后用EXCEL打开就明白 了$url=http:/finance.yahoo.com/d/quotes.csv.?s=.$symbol.&e=.csv&f=sl1d1t1c1ohgv; if(!($contents=file_get_contents($url) die(failure to open.$url); list($symbol,$quote,$date,$time)=explode(,$contents); echo $symbol.:.$quote.; echo $date.; echo $url.; echo .$url.;?directory_submit.html代码如下:无标题文档Submit your siteSubmit siteURL:Email contact:directory_submit.php代码如下:?php $url=$_REQUESTurl; $email=$_REQUESTemail;/parse_url($url)得到URL不同部分的相关数据$url=parse_url($url);/测试主机是否存在,返回IP$hostname=$urlhost;if(!($ip=gethostbyname($hostname)echo host for url dose not have valid ip;exit;echo Host is at IP $ip;/做简单的EMAIL测试$email=explode(,$email);$emailhost=$email1;/在windows下没有dns_get_xm()函数,故下面在windows下须注释掉/* if(!dns_get_mx($emailhost,$mxhostsarr)echo Email address is not at valid host;exit; */echo Email address is delivered via : ;echo .$email0.$email1.;echo all submitted details are ok.;?ftp_mirror.php代码如下:?php $host=192.168.0.2;$user=second;$password=1;$remotefile=ftp/http.rar;$localfile=F:ftpfilehttp.rar;$conn=ftp_connect($host);if(!$conn) echo Error:could not connect to ftp server;exit; echo Connected to $host.; $result=ftp_login($conn,$user,$password);if(!$result)echo Error:could not log on as $user;exit;echo logged in as $user ;if(file_exists($localfile)$localtime=filemtime($localfile);echo local file last updated : ;echo date(G:i j-M-Y,$localtime);echo ;else$localtime=0;if(file_exists($remotefile) echo the remotefile is exists!.;else echo the remotefile isnt exists.;$remotetime=ftp_mdtm($conn,$remotefile);echo $remotetime.; if(!($remotetime=0)echo cant access remote file time.;$remotetime=$localtime+1;elseecho remote file last updated : ;echo date(G:i j-M-Y,$remotetime);echo ;if(!($remotetime$localtime) echo Local copy is up to date.; exit;echo Getting file from server.;$fp=fopen($localfile,w);if(!$success=ftp_fget($conn,$fp,$remotefile,FTP_BINARY)echo Error:Could not download file;ftp_quit($conn);exit;fclose($fp);echo File downloaded successfully;ftp_close($conn);?
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号