Read in the forum regarding "how to preserve textarea linebreak" in PHP... I'm not a PHP programmer, I'm not sure. So.... searching online & found this method: nl2br()
I tried it out, and it is quite simple.
Have zipped it up for future reference~~ Might be useful.
oops...the previous script cannot handle DOUBLE QUOTE & SINGLE QUOTE.
Have added stripslashes() in order to cope for double quote & single quote.
Instead of nl2br(), we shd use nl2br(stripslashes($strText1)).
Thursday, May 7, 2009
Wednesday, May 6, 2009
Auto iFrame Height
How can we detect the content (page) of iFrame, and set the height of the iFrame???
Take a look on this. It is pretty simple.
Anyway, few things to take note:
1. Parent page & child page must in from the same domain.
2. Must add the [class="autoHeight"] for the iFrame. *autoHeight.js will be checking on the existence of this class before resizing the height.
Already zip it here...
Take a look on this. It is pretty simple.
Anyway, few things to take note:
1. Parent page & child page must in from the same domain.
2. Must add the [class="autoHeight"] for the iFrame. *autoHeight.js will be checking on the existence of this class before resizing the height.
Already zip it here...
Friday, May 1, 2009
Backup/RestoreMySQL thru command
Below are mysqldump commands for backup and restore mysql database:
WINDOWS:
Backup:
C:\mysql\bin> mysqldump --opt --user=username --password database > dumbfile.sql
Restore:
C:\mysql\bin>mysql --user=username --password database < dumpfile.sql
UNIX / LINUX (never try this before...)
Backup:
mysqldump --opt --user=username --password database > dumbfile.sql
Restore:
mysqldump --opt --user=username --password database < dumbfile.sql
Notes:
- dumbfile.sql contains SQL command for creating tables and data. (CREATE,INSERT,DROP etc.)
WINDOWS:
Backup:
C:\mysql\bin> mysqldump --opt --user=username --password database > dumbfile.sql
Restore:
C:\mysql\bin>mysql --user=username --password database < dumpfile.sql
UNIX / LINUX (never try this before...)
Backup:
mysqldump --opt --user=username --password database > dumbfile.sql
Restore:
mysqldump --opt --user=username --password database < dumbfile.sql
Notes:
- dumbfile.sql contains SQL command for creating tables and data. (CREATE,INSERT,DROP etc.)
Subscribe to:
Posts (Atom)