Phpmyadmin安装配置简单实现-超简单

前些日子装好了PHP的环境,然后安装上了MYSQL,网上说phpmyadmin可以简单的以图形界面管理mysql,于是就安装了一个phpmyadmin,结果一打开,显示“访问被拒绝”,首次接触php,不知道从哪里下手解决问题,从网上搜啊搜怎么说的都有,但就是没有一个能解决问题的,愁。
不甘心,今天晚上又搜,找到一篇文章,如题,结果真就把问题解决了,原来简单的问题复杂化了。
下面是内容,原文:

Quote
#Tar jxvf phpMyAdmin-2.10.1-all-languages.tar.bz2 //解压

#mv phpMyAdmin-2.10.1-all-languages /var/www/html/database //讲整个目录移到默认的WEB根目录下并改文件名为database

#cp config.inc.sample.php config.inc.php //将config.inc.sample.php改为config.inc.php

#vi config.inc.php

$cfg[’Servers’][$i][’auth_type’] = ‘cookie’;// phpMyAdmin有3种授权模式:
cookie: 显示一个web登录页面,输入mysql的用户名和密码,然后进入管理界面
http: 显示1个windows登录框,输入mysql的用户名和密码,然和进入管理
config: 把mysql用户名和密码直接填入config.inc.php,不显示登录界面,直接进入管理界面
phpMyAdmin的配置文件名为config.inc.php,各版本的config.inc.php修改方法如下:

$cfg[’blowfish_secret’] = ‘php’;(其中的”php”自定义)
修改以后,以后登入phpmyadmin就方便多了,但一定不要使用空密码,切记!

我什么也没修改,就是把$cfg[’blowfish_secret’] 的值设定了一个,结果访问通过了,一切正常。
唉,希望和我一样初次接触PHP的朋友能够不在为这么简单的问题而困惑!

甜甜薄荷糖

http://www.ishere.cn/wp-content/uploads/200707/12_151731_76edb6e6af52bd337ea655a42b4768cc.jpg

关于我想变成一棵树的想法,我
一直无法启齿。并非人际关系失
败,男女关系低能,或是毫无成
就感。更别把弗洛伊德、女性主
义,或者悲惨童年给牵扯进来。
我想做一棵树,只想随风飘摇。
枝叶繁茂。

我想做一棵树、只想青青翠翠。
平凡稳定。请别将简单的问题变
得复杂……有个朋友还只想做一
颗甜甜的薄荷糖呢。

access数据库导入mssql应该注意的几个地方[转]

1、在ACCESS中经常使用的自动编号字段,导入到MSSQL后,他并不是自增型的INT,需要手工设置,把导入后的自动编号字段的标识的“否”改为“是”,“种子”和“递增量”都为“1”,才能成为自动编号;

2、在MSSQL SERVER中,有许多保留字,在ACCESS中是没有的,当你把数据导入到MSSQL的时候,问题就出来了。MSSQL在导入的时候,会自动给这些字段(包括数据库中的表名)加上“[字段名]”,因此,你必须修改你的脚本,把相应的字段名字(或者表名字)加上中括号,或改变字段名字为不是MSSQL的保留字。
例如user应该写为[user]
(具体是那些,请参考有关资料)

3、在用ACCESS关于时间的使用,大家喜欢使用“SELECT * FROM AAAA WHILE TIME="&NOW()”这样的SQL语句,然而,在MSSQL中没有“NOW()”这个函数,而是使用“GETDATE()”,所以,所有的SQL语句中的“NOW()”必须换成“GETDATE()”,请吧sql语句和默认值改为getdate()。

4、在ACCESS中SQL如果用到mid(str,bengin,strlen),在MSSQL中没有这个函数,可以用这个代替left(right(str,len(str)-1),strlen),例如
Mid(”202.097.181.059”,5,3)
改为:left(right(”202.97.181.059”,len(”202.097.181.059”)-),3)

5、在ACCESS的SQL语句中的时间使用变量查询的时候,大家一般使用“SELECT * FROM AAAA WHILE TIME=#"&变量名&"#"”,在MSSQL中是不行的,他的语法是“SELECT * FROM AAAA WHILE TIME=”"&变量名&"”"”。(意思是让你把日期时间变量当成字符串来使用,呵呵~~~)

6、在需要用到时间计算的时候,通常大家使用“SELECT * FROM AAAA WHERE DATEDIFF(”dd”,#"&NOW()&"#,被比较的字段名)>0”这样的语法,在使用到MSSQL的时候是绝对通不过的,即使把#"&NOW()&"# 换成了”"&GETDATE()&"”也没有用,因为MSSQL中的DATEDIFF()函数不认识“”计算类型””里的单引号,你必须使用双引号,并且使用两个(ASP的语法规则)。因此这样的语句应该换成“SELECT * FROM AAAA WHERE DATEDIFF(""dd"",”"&GETDATE()&"”,被比较的字段名)>0”。

7、在ACCESS数据表中的“是/否”类型字段,导入到MSSQL后,是BIT字段,他的值不再是“TRUE”或“FALSE”,而是“1”和“0”,并且“1”和“0”在ASP中并不绝对等同于“TRUE”或“FALSE”,因此在引用这些数据的时候,要加以注意。

8、ACCESS中备注型在MSSQL中改为TEXT或者NTEXT性,长度默认为16就可以,不影响贴子长度!
9、ACCESS中SQL语句 delete * from 表名…. 再MS SQL中改为delete from….

10、ACCESS 中的好多默认值在MSSQL中需要手工添加,特别是int型,请对照改动!

解决Prototype.js传递中文参数的问题!

2007/06/29 更新:
增加随机码,确保每次都有效读取。

============================

这段时间一直对javascript挺感兴趣的。
前些日子开始用prototype的一些脚本,说起来惭愧,早就存在而且出名的东东,自己竟然不知道,唉。
用prototype.js的Ajax.Request实现异步传递真不错,可以把整个表单转换成string来传递,也可以单独获取某一个文本域的值,可是有一个缺点就是不支持中文参数传递(可能是我没发现),毕竟是老外的写的东东。经过一番琢磨,我发现是在内部脚本中对参数编码的问题,老外不管什么参数都用encodeURIComponent()函数进行编码,而中文则适用于escape()函数。经过测试,问题解决了,可以实现传递中文参数了。在实际应用中,可以指定encoding,若:encoding:”gb2312″,则自动转换为escape()函数进行编码;若不指定encoding则使用默认函数encodeURIComponent()。

我把修改过了prototype.js放上来,需要的朋友下载就是了,版本是1.5.0

Click Here To Download

验证码表现类

近一段时间网上对BLOG恶意评论与引用越来越猖狂,真是太可恶了,提交需要验证码也不能阻止,真是气死我了. 想想原因,还是在验证码上,网上传说那些机器人可以分析验证码图片,真是太牛X了,但是你分析出来了也还是要提交的,对,就从输入框这下手,阻止他们!! 这招还真管用,我的BLOG自从换了验证码输入形式以后,几乎没有了机器人提交的东西,呵呵.下面给大家分享一下,希望为清理网络环境出一点力!

// JavaScript Document===验证码表现类
/*
///////////////////////////////////////////////////////////////////////////////
Jena’s Blog
作 者: 迦楠(Jena.want)
版权所有: IsHere.cn
技术支持: jena.want@gmail.com
单元名称: JENAValidCode
开始时间: 2007-5-30
最后修改:
参 数: instanceName-输入框名称;imgUrl-验证码程序地址;inputAmount-验证码位数.
备 注: 这是一个验证码表现类,支持内嵌各种类型的验证程序(gif,bmp…)
///////////////////////////////////////////////////////////////////////////////
*/
var inputsAmount;
function JENAValidCode(instanceName,imgUrl,inputAmount,inputStyle){
this.InstanceName = instanceName || ‘CheckCode’;
this.ImgUrl = imgUrl || ‘CheckCode.asp’;
this.InputAmount = inputAmount || 4;
this.InputStyle = inputStyle || ‘text’;

inputsAmount=this.InputAmount;
}
JENAValidCode.prototype.Create=function(){
var strs=”";
strs+= “<input name=”"+ this.InstanceName +”" type=”hidden” id=”"+ this.InstanceName +”" />”;
for(var i=1;i<=this.InputAmount;i++){
if(i==1){
strs+= “<input name=”scode1″ id=”scode1″ maxlength=”1″ type=”text” class=”"+ this.InputStyle +”" onKeyUp=”javascript:if(this.value!=”&&scode”+ (i+1) +”.value==”){scode”+ (i+1) +”.style.display=”;scode”+ (i+1) +”.focus();this.style.borderRight=’0px’;}”+ this.InstanceName +”.value=MusterValue()” style=”text-align:center; width:14px;” />”;
}else if(i==this.InputAmount){
strs+= “<input name=”scode”+ i +”" id=”scode”+ i +”" maxlength=”1″ type=”text” class=”"+ this.InputStyle +”" style=”display:none;text-align:center; width:14px; border-width:1px 1px 1px 0px” onKeyUp=”javascript:”+ this.InstanceName +”.value=MusterValue()” />”;
}else{
strs+= “<input name=”scode”+ i +”" id=”scode”+ i +”" maxlength=”1″ type=”text” class=”"+ this.InputStyle +”" style=”display:none;text-align:center; width:14px; border-width:1px 1px 1px 0px” onKeyUp=”javascript:if(this.value!=”&&scode”+ (i+1) +”.value==”){scode”+ (i+1) +”.style.display=”;scode”+ (i+1) +”.focus();this.style.borderRight=’0px’;}”+ this.InstanceName +”.value=MusterValue()” />”;
}
}
strs+= ” <img src=”"+ this.ImgUrl +”? + Math.random()” id=”secCode” align=”absmiddle” />”;
strs+= “<span style=”font-family:Verdana;font-size:9px;cursor:pointer;” onclick=”javascript:document.getElementById(‘secCode’).src=’”+ this.ImgUrl +”?’ + Math.random();scode1.value=”;scode1.focus();”
for(var i=2;i<=this.InputAmount;i++){
strs+=”scode”+ i +”.value=”;”
}
strs+=”"> Another</span>”;
document.writeln(strs);
//return strs;
}
function MusterValue(){
var mustervalue=”";
for(var i=1;i<=inputsAmount;i++){
mustervalue+=document.getElementById(“scode”+i).value
}
return mustervalue;
}

js操作cookies

function setCookie(name,value) { var Days = 30; var exp = new Date(); //new Date(“December 31, 9998″); exp.setTime(exp.getTime() + Days*24*60*60*1000); document.cookie = name + “=”+ escape (value) + “;expires=” + exp.toGMTString(); } function getCookie(name) { var arr,reg=new RegExp(“(^| )”+name+”=([^;]*)(;|$)”); if(arr=document.cookie.match(reg)) return unescape(arr[2]); else return null; } function delCookie(name) { var exp = new Date(); exp.setTime(exp.getTime() – 1); var cval=getCookie(name); if(cval!=null) document.cookie= name + “=”+cval+”;expires=”+exp.toGMTString(); }

在JS中实现日期相加

function DateAdd(interval,number,date){
/*
*————— DateAdd(interval,number,date) —————–
* DateAdd(interval,number,date)
* 功能:实现VBScript的DateAdd功能.
* 参数:interval,字符串表达式,表示要添加的时间间隔.
* 参数:number,数值表达式,表示要添加的时间间隔的个数.
* 参数:date,时间对象.
* 返回:新的时间对象.
* var now = new Date();
* var newDate = DateAdd(“d”,5,now);
* author:wanghr100(灰豆宝宝.net)
* update:2004-5-28 11:46
* modify:Jean.want(ishere.cn)
* modifydate:2007-5-23 16:57
*————— DateAdd(interval,number,date) —————–
*/
number=parseInt(number);
switch(interval){
case “y” :
{date.setFullYear(date.getFullYear()+number); break; }
case “q” : { date.setMonth(date.getMonth()+number*3); break; }
case “m” : { date.setMonth(date.getMonth()+number); break; }
case “w” : { date.setDate(date.getDate()+number*7); break; }
case “d” : { date.setDate(date.getDate()+number); break; }
case “h” : { date.setHours(date.getHours()+number); break; }
case “m” : { date.setMinutes(date.getMinutes()+number); break; }
case “s” : { date.setSeconds(date.getSeconds()+number); break; }
default : { date.setDate(d.getDate()+number); break; }
}
return date.toLocaleDateString();
}

艾薇儿新歌《The Best Damn Thing》好听的很,下载下来听听

http://www.ishere.cn/wp-content/uploads/200705/22_084457_girlfriendthebestdamnthing.mp3

Avril Lavigne – The Best Damn Thing
专辑:The Best Damn Thing
LRC Produced By
Album:The Best Damn Thing
Avril Lavigne-The Best Damn Thing
Let me hear you say hey hey hey
Alright, now let me hear you
say hey hey ho
I hate it when a guy doesn’t get the door
Even though I told him yesterday
and the day before
I hate it when a guy
doesn’t get the tab
And I have to pull my money out
and that looks bad
Where are the hopes,
where are the dreams
My Cinderella story scene
When do you think
they’ll finally see
That you’re not not not
gonna get any better
You won’t won’t won’t
you won’t get rid of me never
Like it or not even though
she’s a lot like me
We’re not the same
And yeah yeah yeah
I’m a lot to handle
You don’t know trouble
but I’m a hell of a scandal
Me I’m a scene
I’m a drama queen
I’m the best damn thing
that your eyes have ever seen
Alright Alright yeah
I hate it when a guy doesn’t understand
Why a certain time of month
I don’t want to hold his hand
I hate it when they go out and we stay in
And they come home smelling like
their ex-girlfriend
But I found my hopes
I found my dreams
My Cinderella story scene
Now everybody’s gonna see
That you’re not not not
gonna get any better
You won’t won’t won’t
you won’t get rid of me never
Like it or not even though
she’s a lot like me
We’re not the same
And yeah yeah yeah
I’m a lot to handle
You don’t know trouble
but I’m a hell of a scandal
Me I’m a scene I’m a drama queen
I’m the best damn thing
that your eyes have ever seen
Give me an A,
always give me what I want
Give me a V,
be very very good to me
R, are you gonna treat me right
I, I can put up a fight
Give me an L,
let me hear you scream loud
One two three four
Where are the hopes,
where are the dreams
My Cinderella story scene
When do you think
they’ll finally see
That you’re not not not
gonna get any better
You won’t won’t won’t
you won’t get rid of me never
Like it or not even though
she’s a lot like me
We’re not the same
And yeah yeah yeah
I’m a lot to handle
You don’t know trouble
but I’m a hell of a scandal
Me I’m a scene I’m a drama queen
I’m the best damn thing
that your eyes have ever seen
Let me hear you say hey hey hey
Alright, now let me hear
you say hey hey ho
I’m the best damn thing
that your eyes have ever seen