CS5 是 Ctrl + 空白鍵
KennyWriter
MD5.ComputeHash()
By the power of magic, the following will work:
function get_VB_hash($text) {
$hash = md5($text);
$hex = pack('H*', $hash);
// Pack as a hex string
$int_arr = unpack('C*', $hex);
// Unpack as unsigned chars
return $int_arr; }
or as one line:
unpack('C*', pack('H*', md5($text)) );
延伸閱讀
http://stackoverflow.com/questions/5544884/how-to-mimic-computehash-vb-function-in-php
AS3 swf call javascript
var r:URLRequest = new URLRequest("javascript:functionName()"); navigateToURL(r,'_self')
Call AS3 function from JS using ExternalInterface class
To call an Actionscript 3 function from Javascript:
import flash.external.ExternalInterface; ExternalInterface.addCallback("changeText", changeTheText); // so javascript from html can talk to flash function changeTheText(t:String):void { txtText.text = t; }
延伸
http://www.hardcode.nl/archives_155/article_334-call-javascript-function-from-as3-and-viceversa
PHP 日期相關
<strong>代碼:</strong> mysql> select NOW(), TO_DAYS(NOW()), CURDATE(), TO_DAYS(CURDATE()); +---------------------+----------------+------------+--------------------+ | NOW() | TO_DAYS(NOW()) | CURDATE() | TO_DAYS(CURDATE()) | +---------------------+----------------+------------+--------------------+ | 2007-01-25 13:11:53 | 733066 | 2007-01-25 | 733066 | +---------------------+----------------+------------+--------------------+ 1 row in set (0.00 sec) mysql> select TO_DAYS(NOW())-10, TO_DAYS(CURDATE())-10; +-------------------+-----------------------+ | TO_DAYS(NOW())-10 | TO_DAYS(CURDATE())-10 | +-------------------+-----------------------+ | 733056 | 733056 | +-------------------+-----------------------+ 1 row in set (0.00 sec) mysql> select NOW(), FROM_DAYS(TO_DAYS(NOW())-10), CURDATE(), FROM_DAYS(TO_DAYS(CURDATE())-10); +---------------------+------------------------------+------------+----------------------------------+ | NOW() | FROM_DAYS(TO_DAYS(NOW())-10) | CURDATE() | FROM_DAYS(TO_DAYS(CURDATE())-10) | +---------------------+------------------------------+------------+----------------------------------+ | 2007-01-25 13:12:07 | 2007-01-15 | 2007-01-25 | 2007-01-15 | +---------------------+------------------------------+------------+----------------------------------+ 1 row in set (0.00 sec)
將伺服器的時區改變
先找到 php.ini
裡面會有以下的 code
[Date] ; Defines the default timezone used by the date functions ;date.timezone =
改成
[Date] ; Defines the default timezone used by the date functions date.timezone = Asia/Taipei
mysql 撈出比今天早的資料
WHERE date_myTable < CURRENT_DATE()
ps: 在dreamweaver cs4 有時會在測試的時候 ok, 存檔後又跳回之前的狀態,建議直接看看原始碼,可能會有好幾個之前的同名query,要把多餘的去掉 。
想要插入一筆資料,再連結一個檔案,後來按回上頁是回到插入資料之前
那就要在要插入資料的那一頁自己有個 FORM 可以送資料,送出去以後再用一個PHP檔案撈資料庫,取得要連結的檔名,同時撈資料的這個檔案沒有 HTML,而是用 HEADER()直接轉到要連結的檔案網址。
PS: HEADER 之前不能有任何的空白,符號… <? … 裡的不算 ?>