博文
[置顶] MySql远程访问设置(2010-01-29 13:36:00)
摘要:
1、用MySql-Front连接本地mysql数据库,在数据库名MySql中的user表中,在右边的Data下面的host设为空(一个空格或者NULL表示为“空”)或者也许远程访问的远程计算机的ip,选择更新按钮就可以了,注意要重新启动mysqld
2、使用下面的命令 grant all on *.* to username@"%" identified by "password"; 将所有的权限给用户username,用户密码为password ......
[置顶] php判断一个字符串是否包含另一个字符串(2010-01-19 13:07:00)
摘要:<?$str="1,2,3,4,5";$s="1";if (count(explode($s,$str))>1) echo "存在"; else echo "不存在";?>......
php操作access数据库代码(2010-01-04 14:34:00)
摘要:<%$dbc=new com("adodb.connection");$a=dirname(__FILE__);$path=$a."\mydata.mdb";$dbc->open("provider=Microsoft.Jet.OLEDB.4.0;Data Source=".$path);$rs=$dbc->execute("select * from dbl_admin"); $i=0; while (!$rs->eof){ $i+=1; $fld0=$rs["dbl_user_name"]; $fld1=$rs["dbl_user_password"]; print_r($fld0->value."======".$fld1->value."<br>"); $rs->movenext(); } $rs->close();%>......
火狐下强制换行(2009-11-24 17:41:00)
摘要:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh" lang="zh"><head profile="http://www.w3.org/2000/08/w3c-synd/#"><meta http-equiv="content-language" content="zh-cn" /><meta http-equiv="content-type" content="text/html;charset=gb2312" /><title>blueidea</title><style type="text/css">/*<![CDATA[*/div { width:300px; word-wrap:break-word; border:1px solid red; }/*]]>*/</style></head><body><div id="ff">aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</div><script type="text/javascript">// <![CDATA[function toBreakWord(intLen){var obj=document.getElementById("ff");var strContent=obj.innerHTML;&n......
php获取本页URL地址(2009-11-23 11:44:00)
摘要:<?echo "http://".$_SERVER['SERVER_NAME'].$_SERVER["REQUEST_URI"];?>......
区别PHP4和PHP5版本的代码(2009-10-10 06:51:00)
摘要:<?$array1=array(1,2,3,4);$array2=null;$array3='non-array';$array4=array('a','b','c');print_r(array_merge($array1,$array2,$array3,$array4));?>
PHP4输出的是Array{ [0] => 1 [1] => 2 [2] => 3 [3] => 4 [4] => 'non-array' [5] => a [6] => b [7] => c}
PHP5输出的是 Warning: array_merge() [function.array-merge]: Argument #2 is not an array in C:\AppServ\www\php\php5.php on line 7 Warning: array_merge() [function.array-merge]: Argument #4 is not an array in C:\AppServ\www\php\php5.php on line 7
......
php实现将xml转换成数组(2008-12-12 13:42:00)
摘要:<? header("Content-Type: text/html; charset=gb2312"); $t=new xml2array(); $t->str="http://***.com/qiminphp.xml"; $m=$t->xarray(); class xml2array{ public $str = ''; public $type = 1; //0为字符串,1为文件 function readxml(){ if($this->type==1){ $this->xmlstr = simplexml_load_file($this->str); }else{ $this->xmlstr = simplexml_lo......
ajax通过post提交中文数据的乱码的解决(2008-12-03 13:14:00)
摘要:提交前中文数据用encodeURIComponent(js的函数) 编码,然后提交到服务器端用urldecode(php函数)解码,然后用iconv("UTF-8", "gb2312", $content)进行编码转换页面编码用的是gb2312......
php输出二维数组(2008-12-03 09:55:00)
摘要:$r是一个二维数据,以下是将其输出foreach ($r as $arrItem){ echo $arrItem[name];} ......
php生成缩微图(2008-12-01 18:03:00)
摘要:<?// 本函数从源文件取出图象,设定成指定大小,并输出到目的文件// 源文件格式:gif,jpg,,png// 目的文件格式:jpg// $srcFile: 源文件// $dstFile: 目标文件// $dstW: 目标图片宽度// $dstH: 目标文件高度function makethumb($srcFile,$dstFile,$dstW,$dstH) { $data = GetImageSize($srcFile,&$info); switch ($data[2]) { case 1: $im = @ImageCreateFromGIF($srcFile); break; case 2: $im = @imagecreatefromjpeg($srcFile); break; case 3: $im = @ImageCreateFromPNG($srcFile); break; } $srcW=ImageSX($im); $srcH=ImageSY($im); $ni=ImageCreate($dstW,$dstH); ImageCopyResized($ni,$im,0,0,0,0,$dstW,$dstH,$srcW,$srcH); //ImageJpeg($ni); ImageJpeg($ni,$dstFile); // 如果需要输出到浏览器,那......
