摘要: <a href="logout.php" style="color:#F09;">注销</a><?phpsession_start();session_destroy();header("location:index.php");?> 阅读全文
posted @ 2012-05-31 15:53 ms.元 阅读(1923) 评论(1) 推荐(0) 编辑
摘要: <?php echo ip2long("192.168.1.189")."<br>"; echo (192*255*255*255+168*255*255+1*256+189)."<br>";?>-10627313313194548645 阅读全文
posted @ 2012-05-22 22:50 ms.元 阅读(795) 评论(2) 推荐(0) 编辑
摘要: function unhtml($content){$content=htmlspecialchars($content);$content=str_replace(chr(13),"<br>",$content);$content=str_replace(chr(32),"<br>",$content);$content=str_replace("[_[","<",$content);$content=str_relace(")_)",">&quo 阅读全文
posted @ 2012-05-21 22:25 ms.元 阅读(676) 评论(2) 推荐(0) 编辑
摘要: 平时用$_post[''],$_get['']获取表单中参数时会出现Notice: Undefined index: --------;虽然可以通过设置错误显示方式来隐藏这个提示,但是这样也有隐患,就是在服务器的日志中会记录这些提示,导致日志文件异常庞大。通过在网上搜索和自己自身的实战总结几种解决方法;方法1:服务器配置修改修改php.ini配置文件,error_reporting = E_ALL & ~E_NOTICE方法2:对变量进行初始化。方法3:做判断isset($_post['']),empty($_post['' 阅读全文
posted @ 2012-05-17 16:50 ms.元 阅读(14582) 评论(1) 推荐(2) 编辑
摘要: 学习mysql之后的一点总结1.想要在命令提示符下操作mysql服务器,添加系统变量。(计算机-系统属性——环境变量——path)2.查询数据表中的数据;select selection_list select * /columnsfrom table_list from table1/table2where primary_constraint group by grouping_columnsorder by sorting_colomns desc降序 select * from table order by id desc;having second_constraint ... 阅读全文
posted @ 2012-05-14 21:32 ms.元 阅读(396) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>long fact(long number);int main(void){ int i; for(i=0;i<=10;i++) { printf("%2d!=%1d\n",i,fact(i)); } return 0;}long fact(long number){ if(number<=1) { return 1; } else { return (number*fact(number-1)); }} 阅读全文
posted @ 2012-05-13 10:39 ms.元 阅读(194) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>#include<stdlib.h>int main(void){int i;for(i=0;i<=20;i++){if(i%5==0)printf("\n");printf("%10d\n",1+(rand()%6));//缩放和平移随机数,扔六面体骰子}return 0;} 阅读全文
posted @ 2012-05-13 10:18 ms.元 阅读(316) 评论(0) 推荐(0) 编辑
摘要: <?phpif(!is_dir('txt'))//判断txt是否为文件夹目录{mkdir('txt');//创建名为txt的文件夹目录$open=fopen('txt/in.txt',"w+");//以读写的方式打开文件 if(is_writable('txt/in.txt'))//如果此文件为可写模式 { if(fwrite($open,"今天是美好的一天,一定要开心哦!《- -》")>0)//写入内容 fclose($open);//关闭文件 echo "<s 阅读全文
posted @ 2012-05-10 16:30 ms.元 阅读(464) 评论(0) 推荐(0) 编辑
摘要: 随机生成数字,字母的代码:<?php//che.phpsession_start();for($i=0;$i<4;$i++) { $rand.=dechex(rand(1,15)); } $_SESSION['check_num']=$rand;$image=imagecreatetruecolor(50,30);$bg=imagecolorallocate($im,0,0,0);//第一次用调色板的时候,背景颜色$te=imagecolorallocate($im,255,255,255);imagestring($image,6,rand(0,20),rand( 阅读全文
posted @ 2012-05-10 10:30 ms.元 阅读(932) 评论(0) 推荐(0) 编辑
摘要: 最近正在学习php入门,现在刚入门,所以许多都不知道,就从最基础的学起,不会的上网查,然后把它记在这个法宝内,就如今天遇到随即函数rand();脑海中想到用它做点啥好呢,最后想起了验证码,数字验证码,字母验证码,中文验证码,可是自己不会呀,咋办呢,上网搜,看别人的代码,开不懂,看视频,听老师讲,将其中所遇到的函数,值得注意的地方都拿笔记下,平常看到一般网页上的随机验证码都是以一定的方框包围起来,貌似就是以图片为背景的。经过边看,自己边敲,虽然遇到很多不会的问题,但是我相信只要自己脚踏实地,一定学会的。现在想做一下总结,自己可能写的很乱,可我相信有一天会实现的。1.产生数字的随机数 ——》创建图 阅读全文
posted @ 2012-05-09 22:37 ms.元 阅读(1645) 评论(0) 推荐(0) 编辑