Input file 文件选择框美化 支持Firefox

闲来无事写了一个.也许用得上

在FF2,IE7,IE6下测试通过

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <meta name="author" content="wuleying" />
  6. <!--<script type="text/javascript" src="ajax.js"></script>-->
  7. <title>测试上传文件</title>
  8. <style type="text/css">
  9. * {font-size:12px;margin:0;}
  10. body {background:#fff;}
  11. form {margin:12px;}
  12. input.file{
  13.     vertical-align:middle;
  14.     position:relative;
  15.     left:68px;
  16.     *left:-218px;
  17.     filter:alpha(opacity=0);
  18.     opacity:0;
  19.     z-index:1;
  20.     *width:223px;
  21.     display:none;
  22. }
  23. form input.viewfile {
  24.     z-index:99;
  25.     border:1px solid #ccc;
  26.     padding:2px;
  27.     width:150px;
  28.     vertical-align:middle;
  29.     color:#999;
  30. }
  31. form p span {
  32.     float:left;
  33. }
  34. form label.bottom {
  35.     border:1px solid #38597a;
  36.     background:#4e7ba9;
  37.     color:#fff;
  38.     height:19px;
  39.     line-height:19px;
  40.     display:block;
  41.     width:60px;
  42.     text-align:center;
  43.     cursor:pointer;
  44.     float:left;
  45.     position:relative;
  46.     *top:1px;
  47. }
  48. form input.submit {
  49.     border:0;
  50.     background:#380;
  51.     width:70px;
  52.     height:22px;
  53.     line-height:22px;
  54.     color:#fff;
  55.     cursor:pointer;
  56. }
  57. p.clear {
  58.     clear:left;
  59.     margin-top:12px;
  60. }
  61. p.filep {
  62.     height:25px;
  63. }
  64. p.clear input {
  65.     float:left;
  66.     margin-right:6px;
  67. }
  68. #error {
  69.     padding-top:5px;
  70.     color:#f00;
  71. }
  72. </style>
  73. </head>
  74. <body>
  75. <form action="" onsubmit="return send();" method="post" name="upfiles" enctype="multipart/form-data"><br />
  76. <input type="hidden" name="max_file_size" value="2097152" />
  77. <input type="hidden" name="do" value="upload" />
  78. <p class="filep">
  79.     <span>
  80.         <label for="viewfile">上传文件:</label>
  81.         <input type="text" onmouseout="document.getElementById('upload').style.display='none';" name="viewfile" id="viewfile" class="viewfile" />
  82.     </span>
  83.     <label for="upload" class="bottom" onmouseover="document.getElementById('upload').style.display='block';">查找文件</label><input type="file" id="upload" size="27" name="upload[]" onchange="document.getElementById('viewfile').value=this.value;this.style.display='none';" class="file" />
  84. </p>
  85. <p class="clear"><input class="submit" type="submit" value="确定上传" /><div id="error"></div></p>
  86. </form>
  87. </body>
  88. </html>

有趣的Perl

最近修改一个站点.用Perl语言写的..

从没碰过..有点犯晕.不过PHP最早就是Perl的一个扩展.语法上十分类似.
就硬着头皮上了.

一打开pl文件就犯了眼晕..
光变量前缀就有三种.

$还是很熟悉的嘛..但在Perl里却只能做为标量变量的前缀

还有一个@与%,分别是数组与哈希数组的前缀

老把@当做抑错符.PHP的习惯还是改不了..

继续学习中…

另:查到Perl的两个全称

Practical Extractoin and Report Language 实用抽取和报表语言

Pathologically Electric Rubbish Lister 变态电子垃圾制造者 (哈哈)

Tags : ,

用 Fast Folder & Command 快速访问常用的文件夹

Fast Folder & Command 是一款超强的外壳增强软件。它可以让您快速访问常用的文件夹。
你只需要在桌面或资源管理器空白处单击鼠标右键就可以在其中找到“快捷文件夹”菜单。通过该菜单你可以快速访问已定义的文件夹进行快捷文件夹编辑或添加操作。

Fast Folder & Command 还可以为您创建快捷命令。快捷命令可以为您启动程序、打开文件夹、运行文件或者启动 URL。你只需要在程序中配置快捷命令的别名与路径,然后打开开始菜单中的运行对话框,输入先前配置程序的别名即可!十分方便!

软件界面:

LOOK:
view.gif

下载地址:http://www.onlinedown.net/soft/49673.htm

(备忘)MySQL实用命令

一 连接MYSQL:

格式: mysql -h主机地址 -u用户名 -p用户密码

1、例1:连接到本机上的MYSQL

首先在打开DOS窗口,然后进入mysql安装目录下的bin目录下,例如: D:\mysql\bin,再键入命令mysql -uroot -p,回车后提示你输密码,如果刚安装好MYSQL,超级用户root是没有密码的,故直接回车即可进入到MYSQL中了,MYSQL的提示符是:mysql>

2、例2:连接到远程主机上的MYSQL

假设远程主机的IP为:10.0.0.1,用户名为root,密码为123。则键入以下命令:
mysql -h10.0.0.1 -uroot -p123
(注:u与root可以不用加空格,其它也一样)

3、退出MYSQL命令

exit (回车)

全文阅读 »

date函数格式化UNIX时间戳时差问题的解决方法

插入数据库里的时间格式是unix时间戳

当再用date函数格式化unix时间戳时发现是格林尼治的时间


$nowtime = time();
$mtime = date('Y-m-d H:i:s',$nowtime);

echo $mtime;

解决方法:

在使用date函数之前先设置默认时区


date_default_timezone_set('Etc/GMT-8');

OK..现在输出的就是东八区的时间了..

浏览最多的10篇日志

评论最多的10篇日志

随机显示的10篇日志