PHP Zip Snippet

February 22, 2012 § Leave a comment

<?php
system("zip -r /PATH/archive.zip /FOLDER_PATH");
?>

Special Characters in email subject – PHP

December 6, 2010 § Leave a comment

I am sure there is a lot of articles talking about how to handle special character in email subject.

Lately, I need to add French word like “è” such special character in the email subject.

So I googled it, generally there are few things to look at.

1. Use “=?UTF-8?B?”.base64_encode($your_subject).”?=”

2. Make sure your source is UTF-8, such as your script, your database source

3. Use UTF-8 encoding email library such as Swiftmailer , this is the rock star in open source email, unbeatable.

And that’s all about it.

Oh you can also use it in the `From Name` like Josè <abc@abc.com> !

Linux Apache Server Web development – note

February 24, 2010 § Leave a comment

Couple things to note.

1.What is the UID of the files that generate by server side  script?

It is ‘apache’

2. Why I cannot use chmod 777 on that file, but I can chmod the file I just created using FTP software?

Because the ftp login UID is not apache.

3. Why my script is not working on deployment server, but work in localhost in windows enviroment?

Many reasons, if it related to above issues, then it would be a UID named ‘user’ script want to write something on that     folder with UID named ‘apache’ (this folder probably you use mkdir command to generate ).

It will happens to be a issue once if the PHP < 6.0  safe mode is turn on .

Where Am I?

You are currently browsing entries tagged with php at Nick Wan L.K..