Friday, February 24, 2006

Vietnamese Fonts problem when export to excel

Anh paste hết đọan text của em vào trong frontpage kết quả chạy tốt hết. Dùng Dreamweaver 2004 tốt anh đang dùng nó đế viết. Cach lam cung nhu vua roisave vao excel.php -> chay apache http://localhost/excel.php roi mo excel (default cua excel la arial unicode)
mo file your_desire_name.xls. take care, ./.tv


I go to view->encoding the selected option is western european instead of UTF-8.
You mean in Dreamweaver -> Preferences -> Fonts ? (neu viet thi viet dung va which applications ?)
I can NOT set in Dreamweaver MX but I can set in Dreamweaver MX 2004
Technical notes:
http://tlt.its.psu.edu/suggestions/international/web/tips/dreamweaver.html
Problem with Dreamweaver MX from macromedia
http://www.macromedia.com/cfusion/knowledgebase/index.cfm?id=tn_16338
./.tv

Should use MX2004 it has corrected the vietnamese fonts see belows. Nếu viết chử Hồ thi cẩn:
- <> encode -> utf-8

Con viết H &7879; thí không cần set gi ca.

(phấn trên của MX2004 H & 7891; o ; phần dưới type Hồ sẻ encode phần trên rồi cut and paste rồi đặt bất cư ở đâu củng sẻ thấy.với điều kiễn chọn fonts arial, times support fonts chuẩn bởi Microsoft. Và applications vẩn giữ mật mã encode H & 7891; o (để khỏng trống nếu không IE sẻ chuyên thành Hồ)






Nếu viết dưới unicode encode nhu trên ví dụ Hố = H & 7879 ; nó sẽ chạy trên bất cu IE, word mà không cần setup unicode. Dùng Dreamweave MX2004 to decode chì viết tiếng vie6t dùng vietkey mode 39 unicode. Lập trang web không cần < meta unicode utf-8 nó se hiện đúng. Chỉ cần chọn fonts mà microsoft supports tiếng viet nhu arial, times vài fonts chuẩn uni-8 You mention that CSVs are native file formats for Excel. In my experience though, Excel chokes on CSVs that have any sort of Unicode encoding. For UCS2, opening them from explorer causes Excel to show all of the cells of a row in the first cell (doesn?t seem to recognize the UCS2 comma); you must use the ?File Open? wizard to specify the delimiter in order for Excel to handle properly. UTF-8 files are opened correctly with regards to cells, but non-ASCII text (such as Chinese characters in my line of work) will be corrupted. Of course, my experience is limited to Excel 2000, but as far as I know Excel 2k has the same limitations. Do you know if there?s any way to get around these, specifically the UTF-8 problem, as my company prefers to work with UTF-8.
Thanks, and love your blog.
http://www.dicks-blog.com/archives/2004/11/08/creating-csv-files/

Excel chay tren nen 7-bit con utf-8 la 8 bit vi vay fai qua fan wizard ma anh da goi. Co le khach hang fai lam nhu vay
anh modify the code de tao ra your_desire_file.txt dung Microsoft word mo ra thi doc good ma khong can open wizard
vi MS word nhan duoc 8 bit. The last bit of character xxxxxxxX does not work with excel.
./.tv

You want that the file embedded with unicode-8 automatically open in excel you see vietnamese fonts right away without
need to convert unicode-8 but excel asked this question ?Em muon wizard nhan dung unicode-8 tu file your_desire_name.xls
without this pop up warning ?

Tuesday, February 21, 2006

CPANEL and database

When you have usr and pw to the control panel it allows you to create the database
Here are the steps:
1. Login cpanel www.xxx.com/cpanel enter usr and pw
2. Click MySQL Database
it will bring to the following form

Add the database by clicking the button "add db" if you name the database is "db" if you login as username: saigon then the database will have saigon_db (it adds username_db where db is the name of your database)
Similar to users if you enter username: admin then it will add saigon_admin
password will the password you type for example you type 123 and pw is 123

Last step you add users into the database by select the database name and users and then click the button named "Add users to db". There are 3 steps need to be done to create the database and the users and its connection. So when connected to the database the file name is called /connection/connect.php
$login_name = "saigon_admin"; // you just created above
$password = "123"; // pw you created above
$dbname ="saigon_db"; // database you created above
$link = mysql_connect("$host","$login_name","$password"); mysql_select_db($dbname,$link) or die(mysql_error());?>

This connect.php file allows to connect to the database of mysql.

After you create the database you can review it by click "phpMyAdmin" at the bottom of the current page of MySQL Database. In here you can add member or remove member for admin your site.

There are 3 ways to add member to your site

1. From website you need to register username and pw in the form and click submit this is normal procedures for everyone, this will allowing member with lowest priority to post

You can increase the priority of this member by change the Rank in the member table (the priority: 1 lowest and priority: 3 highest)
2. You can add the member direct from table using phpMyAdmin make sure select encrypt for the password. Here is the enscript code of your pwd before it is stored in the database so no one know what it is, and it looks like something $1$rB1/MDpZ$jCXrblB2p0W38rQrrvylH. if you check the password field when it has been encrypted.

$Pass = crypt(trim($_POST["password"]));

3. You run this piece of code then enter into the password field without no enscript because when it echo into the screen you can cut the string and paste into the password field.

This is how 123 after encripted will look like
123
$1$Bt1.0o0.$LDUHS///PwOuRVMGJZjYn. (you can add this string into the pwd field and remember to select function field is BLANK instead of enscript because this string has been enscrip the following code.

The code to do this


# You should pass the entire results of crypt() as the salt for comparing a# password, to avoid problems when different hashing algorithms are used. (As# it says above, standard DES-based password hashing uses a 2-character salt,# but MD5-based hashing uses 12.)
$password = "123";
echo "$password";
echo "
";
$password1 = crypt("123");
$echo "$password1";

?>




Wednesday, February 15, 2006

oscommerce 2.2ms2-051113 install

Thuy,
Anh install oscommerce tren server neu ai muon su dung tren server hay local thi doc phan sau. Distribute to them !!!

Anh upload version of oscommerce len trang http://www.saigonbestbuy.com/ cua minh. Tren web cau truc nhu vay.
De vao admin oscommerce. http://www.saigonbestbuy.com/oscommerce/oscommerce-2.2ms2-051113/catalog/admin/
De hieu cu di tu tu vao http://www.saigonbestbuy.com/oscommerce -> roi click oscommerce-2.2ms2-051113 -> catalog
nhu vay moi biet tu root den admin co bao nhieu files.
Cau truc oscommerce:
oscommerce-2.2ms2-051113 -- version oscommerce cung o directory co file huong dan documentation.pdf + config.php
(config de connect database no nam ben trong /includes dem ra day de de thay doi)
catalog
admin
download
images
includes
install
images
includes
templates
pub
extras
register_global_v1.3a --- day la patch cho oscommerce anh da install roi neu khong co phan nay se co loi
catalog Server Requirement Error: register_globals is disabled in your PHP configuration
admin
includes
install
includes

Muon tao o apache locate file thi download directory xuong local file (khoang 4 MB)
theo chi dan cua o /oscommerce-2.2ms2-051113/documention.pdf
Dai khai
tao database name: oscommerce (tren server thi saigon_oscommerce lay ten cua usr: saigon tu dong tao ra)
add username: oscom (tren server thi saigon_oscom)
pw: oscom

- Co 2 cach de install
Cach 1:. la chay file
http://www.saigonbestbuy.com/oscommerce/oscommerce-2.2ms2-051113/catalog/install/
(chay o local http://localhost/oscommerce/oscommerce-2.2ms2-051113/catalog/install)
dien vao: server: localhost usr: oscom pw: oscom click: database click: persistant connection
(xem huong dan ro rang o document.pdf page 8)
Cach 2: la import database cua oscommerce oscommerce.sql o /oscommerce-2.2ms2-051113/catalog/install

Cuoi cung: ftp cua http://www.saigonbestbuy.com/ username: pw:

Note: co 2 configure.php fai sua va thong nhat (must be the same with usr and pw) are:
Reset the permissions on /catalog/includes/configure.php to 644 Reset the permissions on /catalog/admin/includes/configure.php to 644.Set privileges 644 dung cuteFTP by ChangeMode (o page 9 of document.pdf)Neu khong set privileges (command cua Linux/Unix tuong duong la chmod -s) to prevent hacker.
If you install the oscommerce successfully like this:

If it is work you type http://www.saigonbestbuy.com/oscommerce/oscommerce-2.2ms2-051113/catalog/admin/you will have your admin like this:

I write about /admin but forget to mention the main page
at local if you install local
http://localhost/oscommerce/oscommerce-2.2ms2-051113//catalog/
on the server
http://www.saigonbestbuy.com/oscommerce/oscommerce-2.2ms2-051113/catalog/