2016年4月21日
摘要: <!--code.php内容--> <?php //开启session session_start(); include "vcode.class.php"; //构造方法 $vcode = new Vcode(80, 25, 4); //将验证码放到服务器自己的空间保存一份 $_SESSION = 阅读全文
posted @ 2016-04-21 20:35 奋斗的寒霜 阅读(190) 评论(0) 推荐(0) 编辑
摘要: <!--demo.html中内容--> <body> <img id="time" src="test.php" /> <script> setInterval(function(){ //让时间动起来 document.getElementById("time").src="test.php?"+ 阅读全文
posted @ 2016-04-21 20:21 奋斗的寒霜 阅读(337) 评论(0) 推荐(0) 编辑
  2016年4月1日
摘要: <?php $filename = "view.html"; //不是必须的, 设置类型 header("Content-Type:text/html"); //当成附件来处理,浏览器就形成下载或打开,并告知文件名是什么 header("Content-Disposition:attachment; 阅读全文
posted @ 2016-04-01 21:24 奋斗的寒霜 阅读(156) 评论(0) 推荐(0) 编辑
摘要: <!--upform.html内容--> <form action="upload.php" method="post" enctype="multipart/form-data" > name: <input type="text" name="username" value="" /><br> 阅读全文
posted @ 2016-04-01 21:10 奋斗的寒霜 阅读(277) 评论(0) 推荐(0) 编辑
摘要: <?php /** file: fileupload.class.php 文件上传类FileUpload 本类的实例对象用于处理上传文件,可以上传一个文件,也可同时处理多个文件上传 */ class FileUpload { private $path = "./uploads"; //上传文件保存 阅读全文
posted @ 2016-04-01 21:08 奋斗的寒霜 阅读(254) 评论(0) 推荐(0) 编辑
摘要: <!--upload.php文件内容--><?phpheader("Content-Type:text/html;charset=utf-8");/* //原来$_FILES的内容Array( [pic] => Array ( [name] => Array ( [0] => 175_2426_3e 阅读全文
posted @ 2016-04-01 20:49 奋斗的寒霜 阅读(322) 评论(0) 推荐(0) 编辑
  2016年3月31日
摘要: <!--upload.php内容--><?php /* 修改php.ini的设置 file_uploads必须是On upload_max_filesize 设置上传文件的大小,此值小于post_max_size post_max_size 设置POST方法可以接收的最大值 upload_tmp_d 阅读全文
posted @ 2016-03-31 21:53 奋斗的寒霜 阅读(270) 评论(0) 推荐(0) 编辑
摘要: <?php //如果多用户访问一个文件,采用文件锁定机制 /* flock()文件锁定 */ header("Content-Type:text/html;charset=utf8"); $filename = "message.txt"; //如果用户提交了, 就写入文件, 按一定格式写入 if( 阅读全文
posted @ 2016-03-31 20:51 奋斗的寒霜 阅读(368) 评论(0) 推荐(0) 编辑
摘要: <?php header("Content-Type:text/html;charset=utf8"); $filename = "message.txt"; //如果用户提交了, 就写入文件, 按一定格式写入 if(isset($_POST['dosubmit'])) { //字段的分隔使用||, 阅读全文
posted @ 2016-03-31 20:38 奋斗的寒霜 阅读(264) 评论(0) 推荐(0) 编辑
  2016年3月28日
摘要: <?php//打开,追加方式$fp = fopen("demo.txt", "a"); rewind($fp);echo ftell($fp)."<br>";//默认在文件末尾追加fwrite($fp, "hello world\n");//关闭fclose($fp); //打开$fp = fope 阅读全文
posted @ 2016-03-28 20:54 奋斗的寒霜 阅读(137) 评论(0) 推荐(0) 编辑