2017年2月24日
摘要: //login.php <html><head></head><body><form action="insert.php" method="POST"><b>用户名:</b><input type="text" name="sname"> <br><br><b>密码:</b><input type 阅读全文
posted @ 2017-02-24 18:41 jiangger 阅读(101) 评论(0) 推荐(1) 编辑
摘要: <?php function checknum($num) { if($num >= 2) { throw new Exception("must below 2"); //抛出异常 } echo "ll <br>"; return true; } try //触发异常 { checknum(2); 阅读全文
posted @ 2017-02-24 18:37 jiangger 阅读(115) 评论(0) 推荐(1) 编辑
摘要: <?php class myexception extends Exception { public function errormessage() { $errmessage = "error :".$this->getline()." in ".$this->getfile()."<b> err 阅读全文
posted @ 2017-02-24 18:36 jiangger 阅读(104) 评论(0) 推荐(1) 编辑
摘要: <?php session_start(); $_SESSION["view"]=1;?><html><body><?php if(isset($_SESSION["view"])) { $_SESSION["view"]=$_SESSION["view"]+1; echo $_SESSION["v 阅读全文
posted @ 2017-02-24 18:35 jiangger 阅读(78) 评论(0) 推荐(1) 编辑
摘要: <?php setcookie("user","姜",time()+60);//设置cookie,并且有时间限制?><?php setcookie("user","jiangger",time()-3600);//删除cookie?> <html> <body> </html> </body> // 阅读全文
posted @ 2017-02-24 18:34 jiangger 阅读(65) 评论(0) 推荐(1) 编辑
摘要: <!DOCTYPE html><body><html> <?php //echo readfile("file.txt"); $fp=fopen("file.txt","x") or die("Unable to open file!");//fopen用于打开和创建文件 // echo fread 阅读全文
posted @ 2017-02-24 18:33 jiangger 阅读(129) 评论(0) 推荐(1) 编辑
摘要: <!DOCTYPE html><html><body><?php date_default_timezone_set("Asia/Shanghai");//设置时区 echo "今天是".date("Y/m/d/l")."<br>"; echo date("Y")."<br>"; echo date 阅读全文
posted @ 2017-02-24 18:32 jiangger 阅读(133) 评论(0) 推荐(1) 编辑
摘要: <html><body><form action = "upload2.php" method = "post" enctype="multipart/form-data"><label for="file">Filename:</label> <br><br> <input type="file" 阅读全文
posted @ 2017-02-24 18:31 jiangger 阅读(112) 评论(0) 推荐(1) 编辑
摘要: <html><body> <h1>欢迎访问我们的首页!</h1><p>一段文本。</p><p>一段文本。</p><div class="menu"><?php include 'menu.php'; //include '../2-html/2-html.php'; // ./表示当前目录 // r 阅读全文
posted @ 2017-02-24 18:27 jiangger 阅读(192) 评论(0) 推荐(1) 编辑
摘要: <!DOCTYPE HTML><html><body> <?php $data=" "; $name = $email= $website1 = $comment = $gener = " "; $nameerr = $emailerr = $gendererr = $websiteerr = " 阅读全文
posted @ 2017-02-24 18:23 jiangger 阅读(686) 评论(0) 推荐(1) 编辑
摘要: //在1.PHP文件中: <!DOCTYPE html><html><body><form action="2.php" method="post">name: <input type="text" name="name"><br>email:<input type="text" name="ema 阅读全文
posted @ 2017-02-24 18:19 jiangger 阅读(158) 评论(0) 推荐(0) 编辑
摘要: <!DOCTYPE html><html><head><style> div{ width:0px; height:0px; background: white; } #first{ border-top: 100px solid white; border-right: 100px solid w 阅读全文
posted @ 2017-02-24 18:16 jiangger 阅读(6758) 评论(0) 推荐(0) 编辑
摘要: <!DOCTYPE html><html><head><style>/*1.不加doctype 低版本解析不同2.id 的属性不能为数字3.文件编码和设置字体相符*/ div{ height:200px; background:blue; }/*每个div独占一行*/ #main{ width:20 阅读全文
posted @ 2017-02-24 18:14 jiangger 阅读(380) 评论(0) 推荐(0) 编辑