3 ways to implement multiple languages website
HTML Css,
javascript jquery,
php mySQL
Friday, April 29, 2016
There is 3 ways to implement multiple languages website.
1)put english, malay, chinese hyperlink on each pages profile-malay.php, profile-english.php, profile-chinese.php. Goodness is simple coding. Two weakness : Weakness 1 is the url is long and ugly. Weakness 2 is hard to maintaince, let say there is the word "age" in 100 pages files, and u want change the "age" to "how old", u need to open 100 pages to change it, very wasting time.
2)profile.php page body content can be changed by using jquery call profile-malay.php, profile-english.php, profile-chinese.php. Goodness is url is short and beautiful. Two weakness : Weakness 1 is lot of jquery coding in begining, for example, if profile-malay.php has the link of edit-malay.php, u need to modify the edit-malay.php to edit.php, then in edit.php jquery call edit-malay.php. What if edit-malay.php have another link save-malay.php? Lot of modifications. Weakness 2 is hard to maintaince, let say there is the label"age" in 100 pages files, and u want change the "age" to "how old", u need to open 100 pages to change it, very wasting time.
3)change all html label into php variable, save all different languages labels into database. Examples, php variable $age for malay language table in database is "umur". Goodness is easy to maintance, when need to change "age" to "how old", no need open all pages, just need to edit the record in database. Goodness 2 don't need to use jquery call another page. No weakness.
1)put english, malay, chinese hyperlink on each pages profile-malay.php, profile-english.php, profile-chinese.php. Goodness is simple coding. Two weakness : Weakness 1 is the url is long and ugly. Weakness 2 is hard to maintaince, let say there is the word "age" in 100 pages files, and u want change the "age" to "how old", u need to open 100 pages to change it, very wasting time.
2)profile.php page body content can be changed by using jquery call profile-malay.php, profile-english.php, profile-chinese.php. Goodness is url is short and beautiful. Two weakness : Weakness 1 is lot of jquery coding in begining, for example, if profile-malay.php has the link of edit-malay.php, u need to modify the edit-malay.php to edit.php, then in edit.php jquery call edit-malay.php. What if edit-malay.php have another link save-malay.php? Lot of modifications. Weakness 2 is hard to maintaince, let say there is the label"age" in 100 pages files, and u want change the "age" to "how old", u need to open 100 pages to change it, very wasting time.
3)change all html label into php variable, save all different languages labels into database. Examples, php variable $age for malay language table in database is "umur". Goodness is easy to maintance, when need to change "age" to "how old", no need open all pages, just need to edit the record in database. Goodness 2 don't need to use jquery call another page. No weakness.
php array on pdo and mysql select and display records to html table
php mySQL
Saturday, May 19, 2012
Steps :
1) Left Join 2 tables in database to retrieve hidden setting_name and stores all of them to an php array.
2) Create full setting_name php array.
3) (left setting name) = (full setting_name) - (hidden setting_name).
4) Join elements of array with needed syntax for sql select query.
5) Join elements of array with needed syntax for header of html table.
6) Join elements of array of sql in while loop with needed syntax for displaying records to body of html table.
Codes :
1) Left Join 2 tables in database to retrieve hidden setting_name and stores all of them to an php array.
2) Create full setting_name php array.
3) (left setting name) = (full setting_name) - (hidden setting_name).
4) Join elements of array with needed syntax for sql select query.
5) Join elements of array with needed syntax for header of html table.
6) Join elements of array of sql in while loop with needed syntax for displaying records to body of html table.
Codes :



















