close
最近弄高鐵的專案, 雖然說被搞到死掉
不過還是有踩到一些地雷, 來 note 一下

關於寄 mail 的部份, 如果是 mail() 送 type 是 text/html 的話
有很多的 Email 系統因為安全性及擋廣告的因素, 會把 img 的部份給擋掉
像是 Gmail, Hotmail, Yahoo! 等等
當然這個是無解的 (有些 Email 系統只要點選不要阻擋就可以看了),
然後記得 img 的 src 參數網址的部份要使用絕對網址, 也就是 http:// 都要寫出來
因為這次要改的檔案有很多, 所以我乾脆偷懶, 在要送的 html 裡面加上
<base href="my url">
這樣我就不需要在每個檔案裡面的 img src 都補上該圖片的絕對網址

不過這樣在 Hotmail 的系統就出現問題, 他不會去讀我的 base 設定 Orz
所以只好土法煉鋼一個個補上去了, 苦! note 一下

另外關於 setcookie 的部份也是, 使用的地方不是說你想到要加就可以加,
不然會無法寫入資料
後來查了一下官網 http://tw2.php.net/manual/en/function.setcookie.php

==
setcookie() defines a cookie to be sent along with the rest of the HTTP headers. Like other headers, cookies must be sent before any output from your script (this is a protocol restriction). This requires that you place calls to this function prior to any output, including and tags as well as any whitespace.
==

這個雷也是踩了好久才恍然大悟, 也是 note 一下, 下次不要再犯了阿 Orz
arrow
arrow
    全站熱搜

    ieon 發表在 痞客邦 留言(1) 人氣()