Sean's Note: 8月 2008

2008年8月28日 星期四

Where Are Windows Vista Cookies !?

The Enigmatic Cookies Folder In Vista
Type Cookies in Start Menu. and it may take you to C:\Users\Username\cookies folder. When you try to click on it, in all probability, you will be greeted with an Access Denied box. This path, however, is just a kind of a pointer.
To see where IE 7 stores its Cookies in Windows Vista :
Open Explorer > Organize > Folder Options > Views > Check 'Do not show hidden files and folders' and Uncheck 'Hide protected OS files' > Apply > OK.
Now you will be able to see the two real locations of Vista's Cookies folders.
C:\Users\username\AppData\Roaming\Microsoft\Windows\Cookies C:\Users\username\AppData\Roaming\Microsoft\Windows\Cookies\Low
As mentioned elsewhere on this site, in Vista, processes run with integrity levels as defined by the Mandatory Integrity Control Feature. 'Protected Mode' Internet Explorer, runs as a 'Low Privilege' process. This prevents the Internet Explorer from writing to areas of the File System or the Registry that require a higher privilege! What happens, is that, Vista creates a set of folders and files, for use with Protected Mode' Internet Explorer. These folders and files share the same Low Privilege level as Internet Explorer.
One of these 4 'low privilege' folders, used by IE7 in Vista, in the course of daily operation, is Cookies, the other being Cache, History & Temp, and is located at:
%AppData%\Microsoft\Windows\Cookies\Low
With the IE 7 Protected Mode Turned On, the browser essentially runs as a low privilege process; as a result of which it can store / read / write cookies in the LOW version of the Cookies folder:
C:\Users\username\AppData\Roaming\Microsoft\Windows\Cookies\Low
But if you have turn UAC off or Disabled the Protected Mode in IE 7, in Windows Vista, they (like cache, temp & history) will mostly be stored in:
C:\Users\username\AppData\Roaming\Microsoft\Windows\Cookies
以上內容源自 : winvistaclub 

2008年8月2日 星期六

[PHP] 中文編碼 " 許功蓋 " 和 " ' "

如果有使用到讓使用者輸入文字的表格,

使用者輸入"許功蓋" 時, 資料庫裡存的會是"許\功\蓋\"

只要加上下面這一行就可以了.


$str = stripslashes($str);

另外使用者如果輸入 " ' " 的時候, PHP 的 query 會出現錯誤訊息,

將一個 '  取代成兩個 '' 就行了, 如下.


$str = str_replace("'", "''", $str);