手机浏览 RSS 2.0 订阅 膘叔的简单人生 , 腾讯云RDS购买 | 超便宜的Vultr , 注册 | 登陆
浏览模式: 标准 | 列表Tag:redis

[转]为什么所有浏览器的userAgent都带Mozilla

为什么浏览器的userAgent第一个都是mozilla呢?看了这个博客后才发现,原来,历史上发生了N多事情,在浏览器大战里,NetScape才是最后的赢家,虽然它已经消失在茫茫人海.
转自[作者:Eamonn 发布时间:2012-01-06 20:04]
时间离现在都有1年过去了,虽然在这一年里发生了很多变化,比如...opera居然也投奔了webkit,看来下一个就是webkit一统江湖了.不知道IE是否能够抗住,firefox呢???

好了不多说了,直接上原文吧.

http://www.eamonning.com/blog.php?id=289
  1. 最早的时候有一个浏览器叫NCSA Mosaic,把自己标称为NCSA_Mosaic/2.0 (Windows 3.1),它支持文字显示的同时还支持图片,于是Web开始好玩起来。  
  2.   
  3.   
  4. 然后出现了一个新的网页浏览器,“Mozilla”,其实就是“Mosaic终结者”的意思,这搞的Mosaic很不爽,(毕竟Mosaic出道早,江湖老),新浏览器最后正式公布的名称是Netscape,它把自己标称为Mozilla/1.0 (Win3.1),更好玩了。Netscape支持框架显示,后来框架在大家中间流行起来了,但Mosaic不支持框架啊,于是伟大的“用户代-理人探测”技术出现了,如果是“Mozilla”,那就发给支持框架的页面,至于其他的浏览器,则发给不含框架的页面。  
  5.   
  6.   
  7. Netscape想逗Microsoft玩儿,把Windows叫做“几乎不曾做过调试的设备驱动器”,后者很恼火。Microsoft于是推出了自己的 网页浏览器,叫做Internet Explorer,希望它能成为“Netscape终结者”。Internet Explorer也支持框架,但它不是Mozilla啊,所以没人给它发送带有框架的页面。Microsoft慢慢烦躁起来,不再寄希望于网站管理员逐渐 认识IE并给它发框架,而是宣称自己是“兼容Mozilla”的,开始模仿Netscape,把自己标称为Mozilla/1.22 (compatible; MSIE 2.0; Windows 95),这样Internet Explorer也能收到框架了,整个Microsoft狂喜,但网站管理员开始有点被搞糊涂了。  
  8.   
  9. Microsoft把IE和Windows一起卖,并且把产品也弄得比Netscape更好了,拉开了第一场浏览器之战。结果和大家知道的一样,Netscape被干掉了,Microsoft大胜、大喜。但是后来Netscape以Mozilla的新名称重生了,构造了Gecko,标称其为Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.1) Gecko/20020826,Gecko属于渲染引擎,表现优异。Mozilla开发了Firefox,标称为Mozilla/5.0 (Windows; U; Windows NT 5.1; sv-SE; rv:1.7.5) Gecko/20041108 Firefox/1.0,并且Firefox表现也非常优秀。Gecko扩张迅速,一些浏览器使用了它的代码并标称为Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.2) Gecko/20040825 Camino/0.8.1 ,这是一个,还有Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.8) Gecko/20071008 SeaMonkey/1.0,另一个,它们都伪装成Mozilla,同时也都是基于Gecko支持的。  
  10.   
  11.   
  12. Gecko表现优秀,IE则很差劲,于是身份甄别再次发生,输送给Gecko的是设计良好的网页代码,其他浏览器就没有这个待遇了。Linux的跟随者很伤心,因为他们创建了基于KHTML引擎支持的Konqueror,但却不会被输送好代码,虽然他们自己认为KHTML和Gecko一样优秀,于是Konquerer开始伪装自己“像Gecko”那样以得到好的网页,并标称自己为Mozilla/5.0 (compatible; Konqueror/3.2; FreeBSD) (KHTML, like Gecko),这个世界更让人困惑了。  
  13.   
  14.   
  15. 后来出现了Opera这样的主儿,宣称“允许用户自己决定让浏览器装成谁”,它的菜单中提供了Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; en) Opera 9.51, Mozilla/5.0 (Windows NT 6.0; U; en; rv:1.8.1) Gecko/20061208 Firefox/2.0.0 Opera 9.51,Opera/9.51 (Windows NT 5.1; U; en) 供大家来选择,选谁是谁。  
  16.   
  17.   
  18.   
  19. Apple开发了Safari,使用了KHTML,同时也增加了很多新特性,后来干脆一锅煮,另起炉灶叫了WebKit,但是它有希望能够得到那些为KHTML编写的网页,于是Safari标称自己为Mozilla/5.0 (Macintosh; U; PPC Mac OS X; de-de) AppleWebKit/85.7 (KHTML, like Gecko) Safari/85.5,这个世界更混乱了。  
  20.   
  21.   
  22.   
  23. Microsoft越来越担心Firefox的发展,重新启动了Internet Explorer的开发,标称自己为Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0) ,可以很好的渲染代码,但那要看网站管理员是否指示它这么做。  
  24.   
  25.   
  26.   
  27. Google也开发了自己的浏览器Chrome, 使用了Webkit,有点像Safari,希望能得到为Safari编写的网页,于是决定装成Safari。这样啊,Chrome使用了WebKit渲染 引擎,想装成Safari,而WebKit呢又伪装自己是KHTML,KHTML呢又是伪装成Gecko的,同时所有的浏览器又都宣称自己是 Mozilla,于是,Chrome宣称自己是Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.2.149.27 Safari/525.13,,UserAgent字符串彻底混乱了,也几乎不再发挥任何作用,每个人都宣称自己是别人,混乱充斥人间啊。  
  28.   
  29.   
  30. 有点调侃的味道,可以总结为一句话:Mozilla是Netscape的吉祥物,也是Netscape Navigator浏览器使用的内部开发代号。由于Netscape早期的影响力,直到今天,所有浏览器包括IE,向Web服务器报告自己的浏览器标识的 时候,都以 “Mozilla”开头,表明自己是Mozilla兼容的。这,就是原因啦。  
  31.   
  32.   
  33. 查看浏览器标记的方法也很容易,通过JavaScript语句:  
  34. javascript:alert(navigator.userAgent)  
  35. 在地址栏输入以上代码,然后回车。 

最后那三段话,不是在每个浏览器中都支持,比如我的firefox18就不支持,后来在firebug的F12的console里直接alert了一下,看了看效果.....
世界已经变了

Tags: mozilla, useragent

IOS6,我是升呢还是不升呢

IOS6的改动列表非常大,你说我是升呢还是不升呢?
因为IOS我还是越狱了,为了两个软件:1、issh,太贵了,不过这个可以买;2、zephyr,这个APP好啊。。。直接iphone支持手势了(否则只有IPAD支持)
刚才一下子看到itunes给的升级列表,我就复制了下来。。。。好纠结,你说我该不该升?升的话,HOME键就又得拼命按了。
iOS 6 软件更新

本更新包含超过 200 项新功能,其中包括:

•  地图
◦  Apple 设计的基于矢量的地图
◦  在 iPhone 5、iPhone 4S、iPad WLAN + Cellular(第 2 代和第 3 代)上实现带语音提示的路线规划导航
◦  实时交通路况信息
◦  Flyover 在 iPhone 5、iPhone 4S、iPad(第 3 代)和 iPod touch(第 5 代)上将主要城市区域以照片般真实的互动式 3D 视图呈现
◦  本地搜索结果附带 Yelp 照片、评分、评论和优惠信息
◦  Siri 集成到获取路线和查找沿线地点的功能中
•  Siri 改进
◦  运动:棒球、篮球、橄榄球、足球和冰球比赛的比分、球员技术统计、赛程、球队阵容和联赛排名
◦  影片:预告片、上映排期、评论和剧情介绍
◦  餐馆:预订、评论、照片等信息
◦  发送推文
◦  发布在 Facebook 上
◦  启动应用程序
◦  在支持的车型上实现免视导航 (Eyes Free)
◦  支持 Siri 的国家/地区都可以使用本地搜索功能(推出初期,可用性可能受限制)
◦  更多国家/地区及语言支持:加拿大(英语和加拿大法语)、中国(普通话)、香港(粤语)、意大利(意大利语)、韩国(韩语)、墨西哥(西班牙语)、西班牙(西班牙语)、瑞士(意大利语、法语和德语)、台湾(国语)以及美国(西班牙语)
◦  支持 iPhone 5、iPhone 4S、iPad(第 3 代)和 iPod touch(第 5 代)
•  Facebook 集成
◦  在“设置”中单次登录
◦  从“照片”、Safari、“地图”、App Store、iTunes、Game Center、“通知中心”和 Siri 直接发布
◦  给任意发布添加位置信息和选择观众
◦  在“通讯录”中查看最新的 Facebook 个人主页照片和联系人信息
◦  在“日历”中查看 Facebook 事件和生日提醒
◦  称“赞”内容和查看朋友们在 App Store 和 iTunes Store 中称“赞”的内容
•  共享的照片流
◦  将选定照片共享给您选择的人
◦  朋友们可以在“照片”应用程序、iPhoto 和 Apple TV 中查看共享的照片
◦  朋友们可以称“赞”并给单独的照片添加评论
•  Passbook
◦  集中管理登机牌、购物卡、电影票和其他凭证
◦  以条形码显示用于登机、购买咖啡、去影院看电影等活动的凭证
◦  凭证会根据时间或位置显示在锁定屏幕上
◦  凭证可自动更新
◦  支持 iPhone 和 iPod touch
•  FaceTime 改进
◦  iPhone 5、iPhone 4S 和 iPad WLAN + Cellular(第 3 代)支持通过蜂窝移动网络进行 FaceTime 通话
◦  在 iPad 和 iPod touch 上接收拨给您的 iPhone 号码的 FaceTime 呼叫
•  电话改进
◦  “勿扰模式”可让您免受来电和通知的打扰
◦  拒绝来电时提供“以信息回复”选项
◦  拒绝来电时根据时间或位置提供“稍后提醒我”选项
•  邮件改进
◦  VIP 邮箱可让您快速找到重要人士的邮件
◦  有旗标电子邮件的专用邮箱
◦  编写电子邮件时可插入照片和视频
◦  打开受密码保护的 Office 文稿
◦  下拉即可刷新邮箱
◦  各个帐户独有签名
•  Safari 改进
◦  iCloud 标签可看到您所有设备上打开的页面
◦  离线阅读列表
◦  照片上传支持
◦  在 iPhone 和 iPod touch 上支持全屏幕横排视图
◦  智能应用程序横幅
◦  JavaScript 性能提升
•  App Store 和 iTunes Store 改进
◦  更新的商店设计
◦  iTunes 预览历史记录
◦  补齐我的整季
◦  补齐我的专辑
•  Game Center 改进
◦  挑战朋友赢得的高分和成就
◦  将所获得的高分和成就发布到 Facebook 和 Twitter
◦  基于您的 Facebook 朋友推荐朋友
•  辅助功能改进
◦  “引导式访问”可将设备限制为使用一个应用程序,或者限制某些屏幕区域上的触碰输入
◦  VoiceOver 与“地图”、AssistiveTouch 和“缩放”功能集成
◦  iPhone 5 和 iPhone 4S 支持“Made for iPhone”助听器
•  增强了“通讯录”、“日历”、“提醒事项”、“照片”以及通过蓝牙共享数据时的隐私控制
•  “提醒事项”应用程序中的提醒事项可被重新排序
•  在 iPhone 上自定振动提醒方式
•  适用于 iPad 的“时钟”应用程序
•  以歌曲作为时钟闹铃
•  在“通讯录”中搜索所有字段
•  自动影片模式实现更强的视频声音质量
•  中文、法文、德文和西班牙文的字词定义
•  适用于法文、德文、土耳其文、加泰罗尼亚文、阿拉伯文和冰岛文的全新键盘布局
•  键盘快捷键可通过 iCloud 在设备间共享
•  蓝牙 MAP 支持
•  HTTP 全局网络代理
•  中国定制功能

◦  百度网页搜索
◦  新浪微博集成
◦  将视频共享到土豆网
◦  将视频共享到优酷网
◦  改进了手写和拼音输入法
•  修正了一些错误

某些功能可能并不适用于所有国家或地区。更多详细信息,请访问此网站:
    http://www.apple.com/ios/feature-availability

有关本更新的安全性内容的信息,请访问此网站:
    http://support.apple.com/kb/HT1222?viewlocale=zh_CN

Tags: ios

php header 设置Cache

在手册里,关于header函数的说明是说服务端会输出一系列的头,用firebug也可以看得很清楚
一般来说,我们用header控制的情况不是特别多,毕竟不会主动去改什么:一般也就设置设置编码、跳转、压缩等,不太会过多的干涉。下载的时候也会设置头,黑黑

手册上,我们对于cache都是写着如何设置,以便让代码不被cache:


header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0"); // HTTP/1.1
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
header("Pragma: no-cache"); // Date in the past

而且在设置的时候还得注意在header前不能有输出,否则header设置无效,但都没有写过,如何给页面设置Cache,虽然我们知道有一些办法,比如 E-TAG之类的。当然也有简单的设置:
比如我们在输出前,对内容进行md5,将它当成e-tag只要没变化,就不会有影响。也有其他的方式:

$seconds_to_cache = 3600;
$ts = gmdate("D, d M Y H:i:s", time() + $seconds_to_cache) . " GMT";
header("Expires: $ts"); header("Pragma: cache");
header("Cache-Control: max-age=$seconds_to_cache");

缓存1小时,主要是过期时间得用gmdate来设置,而不是date,这个要注意,其他都差不多。maxage要和expire能够对得上。

不算笔记的笔记。

Tags: header

随便说说

其实本不想说什么,但是觉得很意外,所以我还是说说了。
一两句而已:
经过某便利店买了瓶啤酒,在收银的时候,一个大妈笑着对我说,送你一个上网软件,扫了一下光盘上的字,立刻就明白了是什么样的软件(XX门,你懂的)。于是我说不需要,我也不想举报你啥的。大妈说,人总要听听外面的声音才是。
我震精了。
---------
现在某些一块、5块的纸币上面多了一些印刷体,委实让人痛苦,扔了吧,可惜,不扔吧,又要传播。TMD,这算是一个什么样的世道??或许你真的有理,但你这样做,就真的没理。

---------
牢骚发完了,继续折腾

Microsoft SQL Server Functions (PDO_SQLSRV)

Introduction

PDO_SQLSRV is a driver that implements the PHP Data Objects (PDO) interface to enable access from PHP to MS SQL Server (starting with SQL Server 2005) and SQL Azure databases.

Installation

The PDO_SQLSRV extension is enabled by adding appropriate DLL file to your PHP extension directory and the corresponding entry to the php.ini file. The PDO_SQLSRV download comes with several driver files. Which driver file you use will depend on 3 factors: the PHP version you are using, whether you are using thread-safe or non-thread-safe PHP, and whether your PHP installation was compiled with the VC6 or VC9 compiler. For example, if you are running PHP 5.3, you are using non-thread-safe PHP, and your PHP installation was compiled with the VC9 compiler, you should use the php_pdo_sqlsrv_53_nts_vc9.dll file. (You should use a non-thread-safe version compiled with the VC9 compiler if you are using IIS as your web server). If you are running PHP 5.2, you are using thread-safe PHP, and your PHP installation was compiled with the VC6 compiler, you should use the php_pdo_sqlsrv_52_ts_vc6.dll file.

For more information about system requirements, see » SQLSRV System Requirements.

The PDO_SQLSRV extension is only compatible with PHP running on Windows. For Linux, see ODBC and » Microsoft's SQL Server ODBC Driver for Linux.

System Requirements (Microsoft Drivers for PHP for SQL Server)

 

SQL Server 2008 R2

To access data in a SQL Server 2005 or later database using the Microsoft Drivers for PHP for SQL Server, you must have the following components installed on your computer:

  • Supported operating systems for version 3.0 of the driver include:

    • Windows Server 2008 R2 SP1

      Windows Vista SP2

      Windows Server 2008 SP2

      Windows 7 SP1

  • Supported operating systems for version 2.0 of the driver include:

    • Supported operating systems for version 2.0 of the driver include:

    • Windows Server 2003 Service Pack 1

    • Windows XP Service Pack 3

    • Windows Vista Service Pack 1 or later

    • Windows Server 2008

    • Windows Server 2008 R2

    • Windows 7

  • PHP 5. For information about how to download and install the latest stable binaries, visit http://php.net.

    Microsoft Drivers for PHP for SQL Server, version 3.0 requires PHP 5.3.0 or later. If possible, use PHP 5.3.6, or later. The version 2.0 driver works with PHP 5.2.4 or later. If possible, use PHP 5.2.13, or later.

  • A version of the driver file must be in your PHP extension directory. See Driver Versions later in this topic for information about the different driver files. See Loading the Microsoft Drivers for PHP for SQL Server for information on configuring the driver for the PHP runtime.

    (See The Data Center for the Microsoft Drivers for PHP for SQL Server for information on where to download the Microsoft Drivers for PHP for SQL Server.)

  • A Web server. Your Web server must be configured to run PHP. For information about hosting PHP applications with Internet Information Services (IIS) 6.0, see Using FastCGI to Host PHP Applications on IIS 6.0. For information about hosting PHP applications with IIS 7.0, see Using FastCGI to Host PHP Applications on IIS 7.0.

    The Microsoft Drivers for PHP for SQL Server has been tested using IIS 6 and IIS 7 with FastCGI.

  • The x86 version of SQL Server Native Client is required on the computer where PHP is running. If you are using a 64-bit operating system, the x86 version of SQL Server Native Client will be installed with the x64 version of SQL Server Native Client (do not install the x86 version of SQL Server Native Client on an x64 operating system).

    If you are using the SQLSRV driver, sqlsrv_client_info will return information about which version of SQL Server Native Client is being used by the Microsoft Drivers for PHP for SQL Server. If you are using the PDO_SQLSRV driver, you can use PDO::getAttribute to discover the version.

This section lists the drivers that are installed for version 2.0 and version 3.0 of the Microsoft Drivers for PHP for SQL Server. PHP version 5.2 is not supported in version 3.0 of the Microsoft Drivers for PHP for SQL Server.

Follow the installation instructions in Loading the Driver to configure the driver for use with the PHP runtime.

Microsoft Drivers 2.0 for PHP for SQL Server installs several versions of the driver:

 

Driver file

PHP version

Thread safe?

Use with PHP .dll

php_sqlsrv_53_nts_vc6.dll

php_pdo_sqlsrv_53_nts_vc6.dll

5.3

no

php5.dll

php_sqlsrv_53_nts_vc9.dll

php_pdo_sqlsrv_53_nts_vc9.dll

5.3

no

php5.dll

php_sqlsrv_53_ts_vc6.dll

php_pdo_sqlsrv_53_ts_vc6.dll

5.3

yes

php5ts.dll

php_sqlsrv_53_ts_vc9.dll

php_pdo_sqlsrv_53_ts_vc9.dll

5.3

yes

php5ts.dll

php_sqlsrv_52_nts_vc6.dll

php_pdo_sqlsrv_52_nts_vc6.dll

5.2

no

php5.dll

php_sqlsrv_52_ts_vc6.dll

php_pdo_sqlsrv_52_ts_vc6.dll

5.2

yes

php5ts.dll

If the name of the driver file contains "vc9", it should be used with a PHP version compiled with Visual C++ 9.0.

Microsoft Drivers 3.0 for PHP for SQL Server installs several versions of the driver:

 

Driver file

PHP version

Thread safe?

Use with PHP .dll

php_sqlsrv_53_nts.dll

php_pdo_sqlsrv_53_nts.dll

5.3

no

php5.dll

php_sqlsrv_53_ts.dll

php_pdo_sqlsrv_53_ts.dll

5.3

yes

php5ts.dll

Tags: sqlserver, microsoft, pdo

Records:612