上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 28 下一页
摘要: 首先是,我已经在页面已经设置了<metahttp-equiv="Content-Type"content="text/html;charset=utf-8"/>我本地运行的时候,不需要在浏览器里面设置字符集,也是可以正常看到字符内容的。但我用ftp上传到服务器之后,就出现了乱码,只有手动去设置浏览器显示的字符集为utf-8才能正常显示。通过这样修改就可以解决了。在页面的头部:<?phpheader('Content-type:text/html;charset=utf-8');?>我也怀疑是不是FTP没有强制上传的 阅读全文
posted @ 2011-05-21 11:03 DavidHHuan 阅读(1356) 评论(0) 推荐(0) 编辑
摘要: 平时我们做开发的时候pasting,经常需要调试。比如说在PHP里面,想输出一个object,只需要<?phpecho'<pre>';print_r($object);echo'</pre>';?>在javascript,我们一般都是用 alert(object) 来做调试的,但是这样是调试不到object的,比如,varobject={'test_1','test_2','test_3'}如果用alert(object);得到的结果是 object object还有,借助goo 阅读全文
posted @ 2011-05-20 02:29 DavidHHuan 阅读(713) 评论(2) 推荐(0) 编辑
摘要: When we using CGridView in Yii, we may want to a link as a column. So in common sense, we will use CLinkColumn to do that, as these code:<?php$this->widget('zii.widgets.grid.CGridView',array('dataProvider'=>$dataProvider,'columns'=>array(array('name'=>& 阅读全文
posted @ 2011-05-19 11:14 DavidHHuan 阅读(1406) 评论(0) 推荐(0) 编辑
摘要: As we know, Drupal7 has changed a lot, and we have to be familiar with it.Here is an example to theme a table with pager.$output='';$header=array(array('data'=>t('Title'),'field'=>'n.title',),array('data'=>'',),);$query=db_select(' 阅读全文
posted @ 2011-05-09 22:14 DavidHHuan 阅读(23554) 评论(2) 推荐(0) 编辑
摘要: look in the source of the d.o theme: <!DOCTYPEhtml><htmlxmlns="http://www.w3.org/1999/xhtml"xml:lang="en"lang="en"dir="ltr"><head><metahttp-equiv="Content-Type"content="text/html;charset=utf-8"/><metahttp-equiv=&q 阅读全文
posted @ 2011-03-31 11:41 DavidHHuan 阅读(656) 评论(0) 推荐(0) 编辑
摘要: Yes, in fact that you can download the source package, and uninstall the firefox 3.6 in Ubuntu and then install the 4.0 version, but how about when you want to own 3.6 and 4.0 at the same time?Here is a way to do it.Add the source.sudoadd-apt-repositoryppa:ubuntu-mozilla-daily/ppaUpdate the sources. 阅读全文
posted @ 2011-03-29 10:27 DavidHHuan 阅读(242) 评论(0) 推荐(0) 编辑
摘要: That is just an example, but do not use it to send the spam email la! :P#!/bin/bashcleari=1while(($i<10))do/usr/sbin/sendmail-v-t-oi-ftestla@testla.com<<EOFFrom:testla@testla.comTo:testla@testla.comSubject:AutomatedDeviceVerificationtest.EOFi=$(($i+1))done 阅读全文
posted @ 2011-03-16 14:53 DavidHHuan 阅读(243) 评论(0) 推荐(0) 编辑
摘要: For example, i have there projects folders in/var/www/project_1/var/www/project_2/var/www/project_3In a common method, I have to set the virtualhost of the three projects as:<VirtualHost*:80><Directory"/var/www/project_1"></Directory>DocumentRoot"/var/www/project_1&q 阅读全文
posted @ 2011-03-10 15:07 DavidHHuan 阅读(224) 评论(0) 推荐(0) 编辑
摘要: When trying to print the date with formate_date as below:<?phpprintformat_date(time(),$type='custom',$format='dFY',$timezone=NULL,$langcode='fr');?>I only can get this result:09March2011The word "March" is in English, but not in French.It is not working for me 阅读全文
posted @ 2011-03-09 11:21 DavidHHuan 阅读(313) 评论(0) 推荐(0) 编辑
摘要: 本本是ThinkPad T410i,安装了ubuntu 10.10之后,发现调节屏幕亮度的功能没了,每次调节亮度之后要重启才能够生效,而且下次重启之后,就又失效了。强大的google帮助了我,我帖一下我的解决方法。在终端一下输入下面命令,修改xorg.confsudovim/etc/X11/xorg.conf原来的内容如下:Section"Screen"Identifier"DefaultScreen"DefaultDepth24EndSectionSection"Module"Load"glx"EndSectio 阅读全文
posted @ 2011-03-09 00:08 DavidHHuan 阅读(1377) 评论(0) 推荐(0) 编辑
摘要: Here i will try to get the taxonomy ID from the path.1) In the view admin page under arguments click on the Taxonomy: Term ID argument and scroll down the page where you’ll see some options for that argument under Defaults: Configure Argument Taxonomy: Term ID.2) Under Action to take if argument is 阅读全文
posted @ 2011-03-02 14:09 DavidHHuan 阅读(407) 评论(0) 推荐(0) 编辑
摘要: <!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><htmlxmlns="http://www.w3.org/1999/xhtml"><head><metahttp-equiv="Content-Type"content="text/html;charset=utf-8"/> 阅读全文
posted @ 2011-02-24 23:36 DavidHHuan 阅读(1342) 评论(0) 推荐(0) 编辑
摘要: 用vim转换M$文本中的换行符^M在 Dos/Windows 里,文本文件的换行符为 \r\n ,而在*nix系统里则为\n,所以 DOS/Windows 里编辑过的文本文件到了 *nix 里,每一行都多了个 ^M 。删掉该字符可以在 VI 里用下面的方法试试:%s/^M$//g # 去掉行尾的^M。:%s/^M//g # 去掉所有的^M。:%s/^M/[ctrl-v]+[enter]/g # 将^M替换成回车。:%s/^M/\r/g # 将^M替换成回车。注意 ^M 的输入用 Ctrl+v,再按回车,或者是 Ctrl+v, Ctrl+m。删除文件内容:1,100d # 删除文件第 1 行到第 阅读全文
posted @ 2011-01-27 14:05 DavidHHuan 阅读(372) 评论(0) 推荐(0) 编辑
摘要: As we know, Drupal does not seperate the frond-end and back-end totally, so the theme of front-end and back-end is the same, though you can set the Administrator theme inadmin/settings/admin/theme, there is still some situation that will make you crazy, you can see my another article about it.[Drupa 阅读全文
posted @ 2011-01-22 11:19 DavidHHuan 阅读(319) 评论(0) 推荐(0) 编辑
摘要: What is CSRF, please see the details here.http://en.wikipedia.org/wiki/Cross-site_request_forgeryIn Yii, how to start the CSRF authorization? It is very easy to do that.Just add this to main.php[代码]And then, do something else to send a request to the server, you have to provide the YII_CSRF_TOKEN ( 阅读全文
posted @ 2011-01-19 15:41 DavidHHuan 阅读(1597) 评论(0) 推荐(0) 编辑
上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 28 下一页