php和mysql web development开发第20章源代码

上传人:灯火****19 文档编号:122352876 上传时间:2020-03-05 格式:DOC 页数:4 大小:32.01KB
返回 下载 相关 举报
php和mysql web development开发第20章源代码_第1页
第1页 / 共4页
php和mysql web development开发第20章源代码_第2页
第2页 / 共4页
php和mysql web development开发第20章源代码_第3页
第3页 / 共4页
php和mysql web development开发第20章源代码_第4页
第4页 / 共4页
亲,该文档总共4页,全部预览完了,如果喜欢就下载吧!
资源描述

《php和mysql web development开发第20章源代码》由会员分享,可在线阅读,更多相关《php和mysql web development开发第20章源代码(4页珍藏版)》请在金锄头文库上搜索。

1、Lockup.php代码如下:?php $symbol=AMZN; /提取信息的关键词 echo stock quote for : . .$symbol.; /原始信息的地址,下载后用EXCEL打开就明白 了$url=http:/ 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.;?d

2、irectory_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

3、 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

4、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(!$resul

5、t)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

6、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);?

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > IT计算机/网络 > 其它相关文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号