摘要: 命令注入攻击 PHP中可以使用下列5个函数来执行外部的应用程序或函数 system、exec、passthru、shell_exec、``(与shell_exec功能相同) 函数原型 string system(string command, int &return_var) command 要执行的命令 return_var 存放执行命令的执行后的状态值 string exec (string command, array &output, int &return_var) command 要执行的命令 output 获得执行命令输出的每一行字符串 return_va 阅读全文
posted @ 2011-07-21 07:41 同城中人 阅读(255) 评论(0) 推荐(0) 编辑
摘要: <?php/**打印乘法口绝表*/echo"九灵九乘法口绝表<br><br><br>";echo"<table>";for($i=1;$i<=9;$i++){echo"<tr>";for($j=1;$j<=$i;$j++){echo"<td>".$j."*".$i."=".($j*$i)."</td>";}echo"</tr>&quo 阅读全文
posted @ 2011-07-14 06:37 同城中人 阅读(343) 评论(0) 推荐(0) 编辑
摘要: <?php/**简单的函数*/functionfontBold($con){return"<B>$con</B>";}$str="简单的函数测试!";echo"普通文本:$str<br>";echo"加粗文本:".fontBold($str)."";/**带可选参数的函数*/functionfontColor($con,$color="bule"){return"<fontcolor=\"$color\&qu 阅读全文
posted @ 2011-07-14 06:35 同城中人 阅读(207) 评论(0) 推荐(0) 编辑
摘要: <?php//打开文件$fp=fopen('tmp.html','r');//读取文件内容 可以用以下两个函数进行操作fread,file_get_contents$str=fread($fp,filesize('tmp.html'));//filesize为获取文件大小$content=file_get_contents('tmp.html'); //读取一行 $line=fgets($fp);直到遇到换行符 //写文件$news=fopen('news.html','w');fwrite( 阅读全文
posted @ 2011-07-14 06:33 同城中人 阅读(176) 评论(0) 推荐(0) 编辑
摘要: <?php /* * 简单的数组定义与访问 */ echo "简单的数组定义与访问<br>"; echo "############################################################<br>"; $address=array(5); $address[0]="福州"; $address[1]="厦门"; $address[2]="漳州"; $address[3]="泉州"; $address[4]=& 阅读全文
posted @ 2011-07-08 00:17 同城中人 阅读(307) 评论(0) 推荐(0) 编辑
摘要: <?php//正则表达 式 // ereg区分大小写 if(ereg("([A-Z]{3,})", "AAA")){ echo "大写能匹配!<br>";}else{ echo "no";}if(ereg("([A-Z]{3,})", "aaa")){ echo "yes";}else{ echo "小写不能匹配!<br>";}// eregi不区分大小写if(eregi("([A-Z]{3,}) 阅读全文
posted @ 2011-06-22 23:58 同城中人 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 一、上传表单的HTML代码<form action="UpLoad.php" method="post" enctype="multipart/form-data" name="upFrm"> <input type="file" name="Imgs" id="Imgs"> <input type="submit" name="subBtn" value="上传" 阅读全文
posted @ 2011-06-22 09:09 同城中人 阅读(198) 评论(0) 推荐(0) 编辑
摘要: 一、连接数据库 1、 mysql_connect: 开启 MySQL 链接 mysql_connect('主机','用户名','密码')2、 mysql_select_db: 打开一个数据库 mysql_select_db('数据库名',$链接标识符) //链接标识符不填写则默认为上一次打开的连接 3、 mysql_query("set names 'GBK'")解决中文乱码问题; mysql_query("set names'编码(utf8或GBK)' ") 阅读全文
posted @ 2011-06-14 23:48 同城中人 阅读(310) 评论(0) 推荐(0) 编辑