摘要:
//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)
推荐(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)
推荐(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)
推荐(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)
推荐(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)
推荐(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)
推荐(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)
推荐(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)
推荐(1)
编辑